mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-01-25 16:33:40 +08:00
chore: Optimize iterator advance() call (#4237)
This commit is contained in:
parent
0927c4d19e
commit
8781daf6e6
@ -1382,7 +1382,7 @@ public:
|
||||
private:
|
||||
void advance() {
|
||||
value = reinterpret_steal<object>(PyIter_Next(m_ptr));
|
||||
if (PyErr_Occurred()) {
|
||||
if (value.ptr() == nullptr && PyErr_Occurred()) {
|
||||
throw error_already_set();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user