Changes between Initial Version and Version 3 of Ticket #19616
- Timestamp:
- Jan 16, 2013, 5:49:35 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #19616 – Description
initial v3 1 1 This is the code from QuerySet (version 1.42). 2 2 As you can see by the lines I've bolded, although _result_cache might be None, it is still being checked for len() 3 3 {{{ 4 4 def __contains__(self, val): 5 5 # The 'in' operator works without this method, due to __iter__. This … … 7 7 # instances, by bailing out early if we find a matching element. 8 8 pos = 0 9 '''if self._result_cache is not None:'''9 if self._result_cache is not None: 10 10 if val in self._result_cache: 11 11 return True … … 15 15 # remember not to check these again: 16 16 pos = len(self._result_cache) 17 '''else:'''17 else: 18 18 # We need to start filling the result cache out. The following 19 19 # ensures that self._iter is not None and self._result_cache is not … … 23 23 # Carry on, one result at a time. 24 24 while True: 25 ''' if len(self._result_cache) <= pos:'''25 if len(self._result_cache) <= pos: 26 26 self._fill_cache(num=1) 27 }}}