[CalendarServer-changes] [7146] CalendarServer/branches/users/glyph/oracle/twext/enterprise/adbapi2. py

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 7 19:06:18 PST 2011


Revision: 7146
          http://trac.macosforge.org/projects/calendarserver/changeset/7146
Author:   glyph at apple.com
Date:     2011-03-07 19:06:18 -0800 (Mon, 07 Mar 2011)
Log Message:
-----------
replace arguments as you go, as documented by the interface

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/oracle/twext/enterprise/adbapi2.py

Modified: CalendarServer/branches/users/glyph/oracle/twext/enterprise/adbapi2.py
===================================================================
--- CalendarServer/branches/users/glyph/oracle/twext/enterprise/adbapi2.py	2011-03-08 03:06:06 UTC (rev 7145)
+++ CalendarServer/branches/users/glyph/oracle/twext/enterprise/adbapi2.py	2011-03-08 03:06:18 UTC (rev 7146)
@@ -112,13 +112,14 @@
         if args is None:
             args = []
         derived = None
-        for arg in args:
+        for n, arg in enumerate(args):
             if IDerivedParameter.providedBy(arg):
                 if derived is None:
-                    # Be sparing with allocations, as this usually isn't needed.
+                    # Be sparing with extra allocations, as this usually isn't
+                    # needed, and we're doing a ton of extra work to support it.
                     derived = []
                 derived.append(arg)
-                arg.preQuery(self._cursor)
+                args[n] = arg.preQuery(self._cursor)
         self._cursor.execute(sql, args)
         if derived is not None:
             for arg in derived:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110307/24e399b0/attachment.html>


More information about the calendarserver-changes mailing list