Remove member function UnicityTable<T>::contains

It was only used once, and the code using it can be simplified.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2021-07-30 06:42:52 +02:00
parent 3313bb794b
commit 739057c586
2 changed files with 1 additions and 10 deletions

View File

@ -69,11 +69,6 @@ public:
return table_.get_index(object);
}
/// Return true if T is in the table
bool contains(T object) const {
return get_index(object) != -1;
}
/// Return true if the id is valid
T contains_id(int id) const {
return table_.contains_index(id);

View File

@ -509,11 +509,7 @@ INT_TEMPLATES_STRUCT *Classify::CreateIntTemplates(CLASSES FloatProtos,
for (unsigned i = 0; i < fs.size(); ++i) {
fs[i] = FClass->font_set.at(i);
}
if (this->fontset_table_.contains(fs)) {
IClass->font_set_id = this->fontset_table_.get_index(fs);
} else {
IClass->font_set_id = this->fontset_table_.push_back(fs);
}
IClass->font_set_id = this->fontset_table_.push_back(fs);
AddIntClass(IntTemplates, ClassId, IClass);
for (ProtoId = 0; ProtoId < FClass->NumProtos; ProtoId++) {