Commit 257b345
committed
gh-144380: Fix incorrect type check in buffered_iternext()
The condition used Py_IS_TYPE(tp, ...) where tp is already a `type`,
this made the fast path unreachable.
Avoid unnecessary method resolution checks in the iteration hot path,
resulting in ~49% faster line iteration for `io.BufferedReader`.1 parent b625601 commit 257b345
File tree
2 files changed
+3
-2
lines changed- Misc/NEWS.d/next/Library
- Modules/_io
2 files changed
+3
-2
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1505 | 1505 | | |
1506 | 1506 | | |
1507 | 1507 | | |
1508 | | - | |
1509 | | - | |
| 1508 | + | |
| 1509 | + | |
1510 | 1510 | | |
1511 | 1511 | | |
1512 | 1512 | | |
| |||
0 commit comments