mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00: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…
Reference in New Issue
Block a user