Repository navigation
Commit 82c62ab
Drop redundant incref/decref pair in dict_dict_merge()
On the override path insertdict() receives its own references to key
and value via Py_NewRef(), and nothing in the loop body uses them
afterwards, so the outer Py_INCREF/Py_DECREF pair was pure overhead.
Keep it only on the non-override path, where _PyDict_Contains_KnownHash()
can run arbitrary __eq__ code and *dupkey needs a live reference.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 9028df3 commit 82c62ab
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4269 | 4269 | | |
4270 | 4270 | | |
4271 | 4271 | | |
4272 | | - | |
4273 | | - | |
4274 | 4272 | | |
4275 | 4273 | | |
4276 | 4274 | | |
4277 | 4275 | | |
| 4276 | + | |
| 4277 | + | |
4278 | 4278 | | |
4279 | 4279 | | |
4280 | 4280 | | |
| |||
4287 | 4287 | | |
4288 | 4288 | | |
4289 | 4289 | | |
| 4290 | + | |
| 4291 | + | |
4290 | 4292 | | |
4291 | | - | |
4292 | | - | |
4293 | 4293 | | |
4294 | 4294 | | |
4295 | 4295 | | |
| |||
0 commit comments