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