Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60b2996

Browse files
committed
Fixed English in a comment; trimmed trailing whitespace;
no code changes.
1 parent 0cdc3d8 commit 60b2996

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

Objects/dictobject.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Dictionary object implementation using a hash table */
33

44
/* The distribution includes a separate file, Objects/dictnotes.txt,
5-
describing explorations into dictionary design and optimization.
5+
describing explorations into dictionary design and optimization.
66
It covers typical dictionary use patterns, the parameters for
77
tuning dictionaries, and several ideas for possible optimizations.
88
*/
@@ -519,10 +519,10 @@ PyDict_GetItem(PyObject *op, PyObject *key)
519519
}
520520

521521
/* CAUTION: PyDict_SetItem() must guarantee that it won't resize the
522-
* dictionary if it is merely replacing the value for an existing key.
523-
* This is means that it's safe to loop over a dictionary with
524-
* PyDict_Next() and occasionally replace a value -- but you can't
525-
* insert new keys or remove them.
522+
* dictionary if it's merely replacing the value for an existing key.
523+
* This means that it's safe to loop over a dictionary with PyDict_Next()
524+
* and occasionally replace a value -- but you can't insert new keys or
525+
* remove them.
526526
*/
527527
int
528528
PyDict_SetItem(register PyObject *op, PyObject *key, PyObject *value)
@@ -554,15 +554,15 @@ PyDict_SetItem(register PyObject *op, PyObject *key, PyObject *value)
554554
/* If we added a key, we can safely resize. Otherwise just return!
555555
* If fill >= 2/3 size, adjust size. Normally, this doubles or
556556
* quaduples the size, but it's also possible for the dict to shrink
557-
* (if ma_fill is much larger than ma_used, meaning a lot of dict
557+
* (if ma_fill is much larger than ma_used, meaning a lot of dict
558558
* keys have been * deleted).
559-
*
559+
*
560560
* Quadrupling the size improves average dictionary sparseness
561561
* (reducing collisions) at the cost of some memory and iteration
562562
* speed (which loops over every possible entry). It also halves
563563
* the number of expensive resize operations in a growing dictionary.
564-
*
565-
* Very large dictionaries (over 50K items) use doubling instead.
564+
*
565+
* Very large dictionaries (over 50K items) use doubling instead.
566566
* This may help applications with severe memory constraints.
567567
*/
568568
if (!(mp->ma_used > n_used && mp->ma_fill*3 >= (mp->ma_mask+1)*2))
@@ -734,7 +734,7 @@ dict_dealloc(register dictobject *mp)
734734
PyMem_DEL(mp->ma_table);
735735
if (num_free_dicts < MAXFREEDICTS && mp->ob_type == &PyDict_Type)
736736
free_dicts[num_free_dicts++] = mp;
737-
else
737+
else
738738
mp->ob_type->tp_free((PyObject *)mp);
739739
Py_TRASHCAN_SAFE_END(mp)
740740
}
@@ -2251,7 +2251,7 @@ static PyObject *dictiter_iternextitem(dictiterobject *di)
22512251
Py_DECREF(PyTuple_GET_ITEM(result, 1));
22522252
} else {
22532253
result = PyTuple_New(2);
2254-
if (result == NULL)
2254+
if (result == NULL)
22552255
return NULL;
22562256
}
22572257
di->len--;

0 commit comments

Comments
 (0)