Commit eab606a8 authored by Raymond Hettinger's avatar Raymond Hettinger

Fix frozenset() ref count and a comment typo.

parent 44e8c43a
...@@ -735,8 +735,7 @@ frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -735,8 +735,7 @@ frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (type == &PyFrozenSet_Type) { if (type == &PyFrozenSet_Type) {
if (emptyfrozenset == NULL) if (emptyfrozenset == NULL)
emptyfrozenset = make_new_set(type, NULL); emptyfrozenset = make_new_set(type, NULL);
else Py_INCREF(emptyfrozenset);
Py_INCREF(emptyfrozenset);
return emptyfrozenset; return emptyfrozenset;
} }
} else if (PyFrozenSet_CheckExact(iterable)) { } else if (PyFrozenSet_CheckExact(iterable)) {
...@@ -803,7 +802,7 @@ set_len(PyObject *so) ...@@ -803,7 +802,7 @@ set_len(PyObject *so)
Useful for creating temporary frozensets from sets for membership testing Useful for creating temporary frozensets from sets for membership testing
in __contains__(), discard(), and remove(). Also useful for operations in __contains__(), discard(), and remove(). Also useful for operations
that update in-place (by allowing an intermediate result to be swapped that update in-place (by allowing an intermediate result to be swapped
into one of original the inputs). into one of the original inputs).
*/ */
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment