Skip to content

Commit 5c8c90b

Browse files
fmt
1 parent e74f84c commit 5c8c90b

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Include/internal/pycore_dict.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key,
3232
Py_hash_t hash);
3333

3434
extern int _PyDict_DelItem_KnownHash_LockHeld(PyObject *mp, PyObject *key,
35-
Py_hash_t hash);
35+
Py_hash_t hash);
3636

3737
extern int _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t);
3838

Objects/odictobject.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,11 +1020,9 @@ OrderedDict___reduce___impl(PyODictObject *od)
10201020
return result;
10211021
}
10221022

1023-
10241023
/* setdefault(): Skips __missing__() calls. */
10251024

1026-
static int PyODict_SetItem_LockHeld(PyObject *self, PyObject *key,
1027-
PyObject *value);
1025+
static int PyODict_SetItem_LockHeld(PyObject *self, PyObject *key, PyObject *value);
10281026

10291027
/*[clinic input]
10301028
@critical_section
@@ -1620,10 +1618,10 @@ PyODict_New(void)
16201618

16211619
static int
16221620
_PyODict_SetItem_KnownHash_LockHeld(PyObject *od, PyObject *key, PyObject *value,
1623-
Py_hash_t hash)
1621+
Py_hash_t hash)
16241622
{
16251623
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(od);
1626-
int res = _PyDict_SetItem_KnownHash_LockHeld((PyDictObject *)(od), key, value, hash);
1624+
int res = _PyDict_SetItem_KnownHash_LockHeld((PyDictObject *)od, key, value, hash);
16271625
if (res == 0) {
16281626
res = _odict_add_new_node(_PyODictObject_CAST(od), key, hash);
16291627
if (res < 0) {
@@ -1651,12 +1649,11 @@ static int
16511649
PyODict_SetItem_LockHeld(PyObject *od, PyObject *key, PyObject *value)
16521650
{
16531651
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(od);
1654-
int res;
16551652
Py_hash_t hash = PyObject_Hash(key);
1656-
if (hash == -1)
1653+
if (hash == -1) {
16571654
return -1;
1658-
res = _PyODict_SetItem_KnownHash_LockHeld(od, key, value, hash);
1659-
return res;
1655+
}
1656+
return _PyODict_SetItem_KnownHash_LockHeld(od, key, value, hash);
16601657
}
16611658

16621659
int

0 commit comments

Comments
 (0)