dtoolbase: Remove unused get_best_parent_from_Set()

This method is no longer used as of e6f870ece6f973fd57ecf57c62ec96a4a898cc6c

Fixes #1421
This commit is contained in:
rdb 2023-01-03 22:45:31 +01:00
parent b10b49bd6b
commit 2d606c07e3
6 changed files with 0 additions and 52 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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<int> &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);
}

View File

@ -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<int> &this_set);
#include "typeHandle.h"
#include "typeRegistry.I"

View File

@ -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<int> &inset) const {
return get_type().get_best_parent_from_Set(inset);
}
/**
* Returns the object, upcast (if necessary) to a TypedObject pointer.
*/

View File

@ -106,8 +106,6 @@ PUBLISHED:
INLINE bool is_exact_type(TypeHandle handle) const;
public:
INLINE int get_best_parent_from_Set(const std::set<int> &) 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.