112 Commits (cb39d1f466eeecbec969f50a5df609eb0a863084)

Author SHA1 Message Date
Benjamin Peterson 1a6292194b fix refleak in deque_concat 11 years ago
Raymond Hettinger 41290a68ba Issue 23793: Add deque support for __add__(), __mul__(), and __imul__(). 11 years ago
Raymond Hettinger fef9c1b368 Fix typo 11 years ago
Raymond Hettinger 8dbbae2e52 Minor code and comment cleanups. 11 years ago
Raymond Hettinger 551350a79f Improve and fix-up comments. 11 years ago
Raymond Hettinger 0f1451c8c0 Issue 23744: Minor speed-up for deque.__bool__(). 11 years ago
Raymond Hettinger 6921c13bbb Minor nit. Make the rotate() success/fail tests consistent. 11 years ago
Raymond Hettinger ac13ad6a32 For safety, wait to decref deleted values until the deque state has been restored. 11 years ago
Raymond Hettinger 0f6f94778a Fix minor formatting nits and remove unnecessary comment. 11 years ago
Raymond Hettinger 32ea16577d Issue 23704: Add index(), copy(), and insert() to deques. Register deques as a MutableSequence. 11 years ago
Raymond Hettinger 39dadf7abf Issue 23705: Improve the performance of __contains__ checks for deques. 11 years ago
Raymond Hettinger 87e691240b Minor neatening-up. Make assignments in same order a struct fields. Line-up comments. 11 years ago
Raymond Hettinger f9d9c79aa8 Switch the state variable to unsigned for defined wrap-around behavior. 11 years ago
Raymond Hettinger 30c9074b96 Minor beautification. Move struct definitions to the top. Fix-up a comment. 11 years ago
Raymond Hettinger f30f5b9ba6 Minor code beautification. Replace macro with in-lineable functions. 11 years ago
Raymond Hettinger 3c186ba441 Beautify and better document the use of the size_t cast for bounds checking. 11 years ago
Raymond Hettinger 7f9ea7543e Issue #23553: Use an unsigned cast to tighten-up the bounds checking logic. 11 years ago
Raymond Hettinger c20830804d Need a (size_t) cast instead of (unsigned) to be big enough for a Py_ssize_t. 11 years ago
Raymond Hettinger a473b9da15 Use unsigned division and modulo for item assignment as well. 11 years ago
Raymond Hettinger 63d1ff2a0b Convert one more division to unsigned arithmetic to speed-up deque_item(). 11 years ago
Raymond Hettinger 7e8c7956a7 Line missed in last checkin 11 years ago
Raymond Hettinger da2850f932 Since the index is always non-negative, use faster unsigned division and modulo. 11 years ago
Raymond Hettinger daf57f25e5 Bump the blocksize up from 62 to 64 to speed up the modulo calculation. 11 years ago
Raymond Hettinger eb6b554fbc Update copyright. 11 years ago
Raymond Hettinger 0e259f18f7 Optimization guides suggest copying memory in an ascending direction when possible. 11 years ago
Raymond Hettinger 507d997714 Add comment and make minor code clean-up to improve clarity. 12 years ago
Raymond Hettinger 4b0b1accb5 Issue #21101: Eliminate double hashing in the C code for collections.Counter(). 12 years ago
Raymond Hettinger 5402315626 Add implementation notes 12 years ago
Benjamin Peterson 9cb33b7d03 correct defaultdict signature in docstring (closes #20250) 12 years ago
Victor Stinner e7f516cbb8 Issue #19512: _count_elements() of _collections reuses PyId_get identifier 12 years ago
Raymond Hettinger cb1d96f782 Issue #18594: Make the C code more closely match the pure python code. 12 years ago
Raymond Hettinger 224c87d60c Issue #18594: Fix the fallback path in collections.Counter(). 12 years ago
Raymond Hettinger 2ff2190b62 Issue #18594: Fix the fast path for collections.Counter(). 12 years ago
Raymond Hettinger 77578204d6 Restore the data block size to 62. 13 years ago
Raymond Hettinger 3223dd5c22 Assertions key off NDEBUG 13 years ago
Raymond Hettinger b97cc49c3a Minor code simplification by eliminating an unnecessary temporary variable. 13 years ago
Raymond Hettinger 90dea4ce43 Tweak the deque struct by moving the least used fields (maxlen and weakref) to the end. 13 years ago
Raymond Hettinger 840533bf1c Use a do-while loop in the inner loop for rotate (m is always greater than zero). 13 years ago
Raymond Hettinger 3959af9b2a Move the freeblock() call outside the main loop to speed-up and simplify the block re-use logic. 13 years ago
Raymond Hettinger d9c116ca40 Add a spacing saving heuristic to deque's extend methods 13 years ago
Raymond Hettinger b385529ddf Fix #ifdef 13 years ago
Raymond Hettinger 82df925451 Use macros for marking and checking endpoints in the doubly-linked list of blocks. 13 years ago
Raymond Hettinger f3a67b7e57 Improve variable names in deque_count() 13 years ago
Raymond Hettinger df715ba54d Apply the PyObject_VAR_HEAD and Py_SIZE macros 13 years ago
Raymond Hettinger 5bfa8671bc Refactor deque_traverse(). 13 years ago
Raymond Hettinger 98054b4c1b Remove unnecessary branches from count() and reverse(). 13 years ago
Raymond Hettinger de68e0cf0e Speed-up deque indexing by changing the deque block length to a power of two. 13 years ago
Raymond Hettinger 20b0f87e1d Misc improvements to collections.deque() 13 years ago
Raymond Hettinger 986bbfc079 Backport deque.rotate() improvements. 13 years ago
Raymond Hettinger 6688bdbe77 Minor cleanups. 13 years ago