only copy when necessary stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 15 Oct 2009 11:39:41 +0200
branchstable
changeset 3679 983c1af59c2a
parent 3673 9342e6783bd2
child 3680 af3656d03376
only copy when necessary
entity.py
--- a/entity.py	Thu Oct 15 10:25:21 2009 +0200
+++ b/entity.py	Thu Oct 15 11:39:41 2009 +0200
@@ -810,7 +810,7 @@
         else raise `KeyError`
         """
         res = self._related_cache['%s_%s' % (rtype, role)][entities]
-        if limit is not None:
+        if limit is not None and limit < len(rset):
             if entities:
                 res = res[:limit]
             else: