Commit 276655a
committed
Remove unreachable second empty-heap check in heappushpop()
The second PyList_GET_SIZE(heap) == 0 check in `_heapq.heappushpop()`
is unreachable and redundant.
The heap size is already validated at entry, and remains stable under
both the GIL and the `@critical_section heap lock` in no-GIL builds.
So remove the extra check to simplify the code.
Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>1 parent cfeede8 commit 276655a
1 file changed
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | 284 | | |
290 | 285 | | |
291 | 286 | | |
| |||
0 commit comments