File tree 1 file changed +2
-3
lines changed 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ PYBIND11_NOINLINE inline handle get_type_handle(const std::type_info &tp, bool t
207
207
return handle (type_info ? ((PyObject *) type_info->type ) : nullptr );
208
208
}
209
209
210
- // Searches all_type_info for a registered instance, i.e. moving up the inheritance hierarchy .
210
+ // Searches the inheritance graph for a registered Python instance, using all_type_info() .
211
211
PYBIND11_NOINLINE inline handle find_registered_python_instance (void *src,
212
212
const detail::type_info *tinfo) {
213
213
auto it_instances = get_internals ().registered_instances .equal_range (src);
@@ -521,8 +521,7 @@ class type_caster_generic {
521
521
if (src == nullptr )
522
522
return none ().release ();
523
523
524
- handle registered_inst = find_registered_python_instance (src, tinfo);
525
- if (registered_inst)
524
+ if (handle registered_inst = find_registered_python_instance (src, tinfo))
526
525
return registered_inst;
527
526
528
527
auto inst = reinterpret_steal<object>(make_new_instance (tinfo->type ));
You can’t perform that action at this time.
0 commit comments