Correct setpath search order
authorJeremy Stanley <fungi@yuggoth.org>
Mon, 19 Sep 2016 15:25:18 +0000 (15:25 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Mon, 19 Sep 2016 15:25:18 +0000 (15:25 +0000)
Short-circuit the outer loop in setpath testing so that we stop
iterating through supplied path elements once a match is found.

weather.py

index 48bb8d1..d00f7ff 100644 (file)
@@ -692,6 +692,8 @@ def data_index(path):
                         os.stat(candidate).st_mtime
                     )
                     break
+            if filename in datafiles:
+                break
     return datafiles
 
 def guess(