]> Savannah Git Hosting - gnulib.git/commitdiff
vfs: simplify table handling
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 8 Oct 2017 15:52:52 +0000 (18:52 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 8 Oct 2017 15:52:52 +0000 (18:52 +0300)
pygnulib/vfs.py

index abc5958c58b9aa707dba9027b7260dff6802fbf5..fcabeb524da4504c274c6459579147f7ecc0d515 100644 (file)
@@ -73,11 +73,9 @@ class Base:
             if part == "..":
                 parts += [part]
                 continue
-            if not replaced:
-                for (old, new) in self.__table.items():
-                    if part == old:
-                        part = self.__table[new]
-                        replaced = True
+            if not replaced and part in self.__table:
+                part = self.__table[part]
+                replaced = True
             parts += [part]
         return _os_.path.sep.join([self.__path] + parts)