diff --git a/dtool/src/dtoolbase/typeHandle.cxx b/dtool/src/dtoolbase/typeHandle.cxx index 6b7ee5aaf7..4cde03258e 100644 --- a/dtool/src/dtoolbase/typeHandle.cxx +++ b/dtool/src/dtoolbase/typeHandle.cxx @@ -166,25 +166,6 @@ get_python_type() const { } #endif -/** - * Return the Index of the BEst fit Classs from a set - */ -int TypeHandle:: -get_best_parent_from_Set(const std::set< int > &legal_vals) const { - if (legal_vals.find(_index) != legal_vals.end()) { - return _index; - } - - for (int pi = 0; pi < get_num_parent_classes(); ++pi) { - TypeHandle ph = get_parent_class(pi); - int val = ph.get_best_parent_from_Set(legal_vals); - if (val > 0) { - return val; - } - } - return -1; -} - std::ostream & operator << (std::ostream &out, TypeHandle::MemoryClass mem_class) { switch (mem_class) { diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index 10997ef67d..ba03589fe0 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -123,8 +123,6 @@ PUBLISHED: INLINE TypeHandle get_parent_towards(TypeHandle ancestor, TypedObject *object = nullptr) const; - int get_best_parent_from_Set(const std::set< int > &legal_vals) const; - size_t get_memory_usage(MemoryClass memory_class) const; void inc_memory_usage(MemoryClass memory_class, size_t size); void dec_memory_usage(MemoryClass memory_class, size_t size); diff --git a/dtool/src/dtoolbase/typeRegistry.cxx b/dtool/src/dtoolbase/typeRegistry.cxx index 0633f5b984..2b731abf39 100644 --- a/dtool/src/dtoolbase/typeRegistry.cxx +++ b/dtool/src/dtoolbase/typeRegistry.cxx @@ -695,21 +695,3 @@ look_up_invalid(TypeHandle handle, TypedObject *object) const { return _handle_registry[handle._index]; } - -/** - - */ -extern "C" int -get_best_parent_from_Set(int id, const std::set &this_set) { - // most common case.. - if (this_set.find(id) != this_set.end()) { - return id; - } - - TypeHandle th = TypeRegistry::ptr()->find_type_by_id(id); - if (th == TypeHandle::none()) { - return -1; - } - - return th.get_best_parent_from_Set(this_set); -} diff --git a/dtool/src/dtoolbase/typeRegistry.h b/dtool/src/dtoolbase/typeRegistry.h index 0051ba68a4..c5dafef6a5 100644 --- a/dtool/src/dtoolbase/typeRegistry.h +++ b/dtool/src/dtoolbase/typeRegistry.h @@ -118,9 +118,6 @@ private: friend class TypeHandle; }; -// Helper function to allow for "C" interaction into the type system -extern "C" EXPCL_DTOOL_DTOOLBASE int get_best_parent_from_Set(int id, const std::set &this_set); - #include "typeHandle.h" #include "typeRegistry.I" diff --git a/dtool/src/dtoolbase/typedObject.I b/dtool/src/dtoolbase/typedObject.I index 37bb183781..1c4f81067b 100644 --- a/dtool/src/dtoolbase/typedObject.I +++ b/dtool/src/dtoolbase/typedObject.I @@ -43,14 +43,6 @@ is_exact_type(TypeHandle handle) const { return get_type() == handle; } -/** - * - */ -INLINE int TypedObject:: -get_best_parent_from_Set(const std::set &inset) const { - return get_type().get_best_parent_from_Set(inset); -} - /** * Returns the object, upcast (if necessary) to a TypedObject pointer. */ diff --git a/dtool/src/dtoolbase/typedObject.h b/dtool/src/dtoolbase/typedObject.h index dd60515f16..3bc9c15e41 100644 --- a/dtool/src/dtoolbase/typedObject.h +++ b/dtool/src/dtoolbase/typedObject.h @@ -106,8 +106,6 @@ PUBLISHED: INLINE bool is_exact_type(TypeHandle handle) const; public: - INLINE int get_best_parent_from_Set(const std::set &) const; - // Derived classes should override this function to call init_type(). It // will only be called in error situations when the type was for some reason // not properly initialized.