Replace at accessor by [] operator in function Classify::CreateIntTemplates

UnicityTable did not provide the [] operator, so add it for this change.

Suggested-by: Egor Pugin <egor.pugin@gmail.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2022-12-12 08:17:43 +01:00
parent a806d21883
commit 369b811c99
2 changed files with 8 additions and 1 deletions

View File

@ -62,6 +62,13 @@ public:
return table_.at(id);
}
T &operator[](size_t id) {
return table_[id];
}
const T &operator[](size_t id) const {
return table_[id];
}
/// Return the id of the T object.
/// This method NEEDS a compare_callback to be passed to
/// set_compare_callback.

View File

@ -509,7 +509,7 @@ INT_TEMPLATES_STRUCT *Classify::CreateIntTemplates(CLASSES FloatProtos,
FontSet fs;
fs.reserve(fs_size);
for (unsigned i = 0; i < fs_size; ++i) {
fs.push_back(FClass->font_set.at(i));
fs.push_back(FClass->font_set[i]);
}
IClass->font_set_id = this->fontset_table_.push_back(fs);
AddIntClass(IntTemplates, ClassId, IClass);