Commits

Anonymous committed 0739e7b

findit: minor clean ups

Comments (0)

Files changed (1)

rope/contrib/findit.py

         name = rope.base.worder.Worder(code).get_word_at(offset)
         if lineno is not None:
             start = module.lines.get_line_start(lineno)
-            def myfilter(occurrence):
+            def check_offset(occurrence):
                 if occurrence.offset < start:
                     return False
             pyname_filter = occurrences.PyNameFilter(pyname)
             finder = occurrences.Finder(project.pycore, name,
-                                        [myfilter, pyname_filter])
+                                        [check_offset, pyname_filter])
             for occurrence in finder.find_occurrences(pymodule=module):
-                occurrence.resource = module.resource
                 return Location(occurrence)
 
 
     for resource in resources:
         job_set.started_job(resource.path)
         for occurrence in finder.find_occurrences(resource):
-            location = Location(occurrence)
-            result.append(location)
+            result.append(Location(occurrence))
         job_set.finished_job()
     return result