# HG changeset patch # User Sylvain Thénault # Date 1255599581 -7200 # Node ID 983c1af59c2ad049cef76ed58ac0a5274c786123 # Parent 9342e6783bd2dedc8dfe61d77493c9893535807e only copy when necessary diff -r 9342e6783bd2 -r 983c1af59c2a 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: