SVN: Zope/trunk/src/OFS/Traversable.py micro optimization

Nikolay Kim <[email protected]>
Newsgroups gmane.comp.web.zope.cvs
Message-ID <[email protected]>
Log message for revision 122281:
  micro optimization

Changed:
  U   Zope/trunk/src/OFS/Traversable.py

-=-
Modified: Zope/trunk/src/OFS/Traversable.py
===================================================================
--- Zope/trunk/src/OFS/Traversable.py	2011-07-18 18:42:54 UTC (rev 122280)
+++ Zope/trunk/src/OFS/Traversable.py	2011-07-18 18:44:15 UTC (rev 122281)
@@ -119,12 +119,9 @@
         calls while walking up from an object on a deep level.
         """
         try:
-            id = self.id
+            id = self.id or self.getId()
         except AttributeError:
             id = self.getId()
-        else:
-            if id is None:
-                id = self.getId()
 
         path = (id, )
         p = aq_parent(aq_inner(self))
@@ -135,12 +132,9 @@
         while p is not None:
             if func is p.getPhysicalPath.im_func:
                 try:
-                    pid = p.id
+                    pid = p.id or p.getId()
                 except AttributeError:
                     pid = p.getId()
-                else:
-                    if pid is None:
-                        pid = p.getId()
 
                 path = (pid, ) + path
                 try:

_______________________________________________
Zope-Checkins maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-checkins
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.