summaryrefslogtreecommitdiffstats
path: root/Objects/setobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed unused initialization and the uninteresting comment.Raymond Hettinger2016-04-291-2/+1
|
* Issue #26880: Removed redundant checks in set.__init__.Serhiy Storchaka2016-04-291-3/+1
|
* Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-1/+1
|\ | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
| * Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-1/+1
| | | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* | Moved misplaced functions to the section for C API functions.Raymond Hettinger2016-03-271-12/+12
| |
* | Responsibility for argument checking belongs in set.__init__() rather than ↵Raymond Hettinger2016-03-261-3/+0
| | | | | | | | | | | | | | set.__new__(). See dict.__new__() and list.__new__() for comparison. Neither of those examine or touch args or kwds. That work is done in the __init__() methods.
* | Speed-up construction of empty sets by approx 12-14%.Raymond Hettinger2016-03-251-2/+3
| |
* | Add early-out for the common case where kwds is NULL (gives 1.1% speedup).Raymond Hettinger2016-02-041-2/+3
| |
* | merge 3.5Benjamin Peterson2016-01-011-3/+0
|\ \ | |/
| * merge 3.4Benjamin Peterson2016-01-011-3/+0
| |\
| | * merge 3.3Benjamin Peterson2016-01-011-3/+0
| | |\
| | | * remove some copyright notices supserseded by the toplevel onesBenjamin Peterson2016-01-011-3/+0
| | | |
| | | * Silence compiler warning for an unused declarationRaymond Hettinger2013-08-041-1/+0
| | | |
* | | | Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka2015-12-191-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
| * | | Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka2015-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
* | | | Minor tweek. Counting down rather than up reduces register pressure.Raymond Hettinger2015-12-151-1/+1
| | | |
* | | | Undo inadvertent line swapRaymond Hettinger2015-12-141-1/+1
| | | |
* | | | Hoist constant expressions (so->table and so->mask) out of the inner-loop.Raymond Hettinger2015-12-141-12/+12
| | | |
* | | | Add assertion to verify the pre-condition in the comments.Raymond Hettinger2015-11-181-0/+1
| | | |
* | | | Issue #25629: Move set fill/used updates out of inner loopRaymond Hettinger2015-11-171-7/+8
| | | |
* | | | Move the active entry multiplication to later in the hash calculationRaymond Hettinger2015-08-071-4/+4
| | | |
* | | | Restore frozenset hash caching removed in cf707dd190a9Raymond Hettinger2015-08-071-0/+3
| | | |
* | | | Fix comment typoRaymond Hettinger2015-08-011-1/+1
| | | |
* | | | Tweak the commentsRaymond Hettinger2015-08-011-1/+3
| | | |
* | | | Issue #24762: Speed-up frozenset_hash() and greatly beef-up the comments.Raymond Hettinger2015-08-011-27/+43
| | | |
* | | | Issue #24681: Move the most likely test first in set_add_entry().Raymond Hettinger2015-07-311-6/+9
| | | |
* | | | Issue #24681: Move the store of so->table to the code block where it is used.Raymond Hettinger2015-07-231-7/+10
| | | |
* | | | Issue #24583: Consolidate previous set object updates into a single functionRaymond Hettinger2015-07-201-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | with a single entry point, named exit points at the bottom, more self-evident refcount adjustments, and a comment describing why the pre-increment was necessary at all.
* | | | Issue #24583: Fix refcount leak.Raymond Hettinger2015-07-201-1/+5
| | | |
* | | | Issue #24583: Fix crash when set is mutated while being updated.Raymond Hettinger2015-07-161-5/+13
| | | |
* | | | mergeRaymond Hettinger2015-07-161-1/+2
|\ \ \ \ | |/ / /
| * | | Issue #24583: Fix crash when set is mutated while being updated.Raymond Hettinger2015-07-161-1/+2
| | | |
| * | | Reverting my previous commit.Yury Selivanov2015-05-301-104/+41
| | | | | | | | | | | | | | | | Something went horribly wrong when I was doing `hg rebase`.
* | | | Neaten-up a little bit.Raymond Hettinger2015-07-081-3/+3
| | | |
* | | | Issue 24581: Revert c9782a9ac031 pending a stronger test for mutation during ↵Raymond Hettinger2015-07-071-13/+22
| | | | | | | | | | | | | | | | iteration.
* | | | Minor bit of factoring-out common code.Raymond Hettinger2015-07-071-18/+11
| | | |
* | | | Tighten-up code in the set iterator to use an entry pointer rather than ↵Raymond Hettinger2015-07-071-22/+13
| | | | | | | | | | | | | | | | indexing.
* | | | Tighten-up code in set_next() to use an entry pointer rather than indexing.Raymond Hettinger2015-07-061-5/+7
| | | |
* | | | Bring related functions add/contains/discard together in the code.Raymond Hettinger2015-07-051-40/+34
| | | |
* | | | Change add/contains/discard calls to pass the key and hash instead of an ↵Raymond Hettinger2015-07-051-52/+42
| | | | | | | | | | | | | | | | entry struct.
* | | | Clean-up call patterns for add/contains/discard to better match the caller's ↵Raymond Hettinger2015-07-051-36/+33
| | | | | | | | | | | | | | | | needs.
* | | | Make the unicode equality test an external function rather than in-lining it.Raymond Hettinger2015-07-041-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The real benefit of the unicode specialized function comes from bypassing the overhead of PyObject_RichCompareBool() and not from being in-lined (especially since there was almost no shared data between the caller and callee). Also, the in-lining was having a negative effect on code generation for the callee.
* | | | Make sure the dummy percentage calculation won't overflow.Raymond Hettinger2015-07-041-2/+2
| | | |
* | | | Minor cleanup.Raymond Hettinger2015-07-041-2/+2
| | | |
* | | | Minor nit: Make the style of checking error return values more consistent.Raymond Hettinger2015-07-041-16/+16
| | | |
* | | | Minor factoring: move redundant resize scaling logic into the resize function.Raymond Hettinger2015-07-041-4/+5
| | | |
* | | | Call set_lookkey() directly to avoid unnecessary memory spills and reloads.Raymond Hettinger2015-07-041-4/+5
| | | |
* | | | Move insertion resize logic into set_insert_key().Raymond Hettinger2015-07-041-45/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplifies the code a little bit and does the resize check only when a new key is added (giving a small speed up in the case where the key already exists). Fixes possible bug in set_merge() where the set_insert_key() call relies on a big resize at the start to make enough room for the keys but is vulnerable to a comparision callback that could cause the table to shrink in the middle of the merge. Also, changed the resize threshold from two-thirds of the mask+1 to just two-thirds. The plus one offset gave no real benefit (afterall, the two-thirds mark is just a heuristic and isn't a precise cut-off).
* | | | Minor refactoring. Move reference count logic into function that adds entry.Raymond Hettinger2015-06-281-14/+4
| | | |
* | | | Minor tweeak to tighten the inner-loop.Raymond Hettinger2015-06-261-1/+1
| | | |