mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-03 00:49:01 +08:00
Remove member function GenericVector<T>::contains
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
739057c586
commit
8b21e4f0b8
@ -103,9 +103,6 @@ public:
|
|||||||
// Return the index of the T object.
|
// Return the index of the T object.
|
||||||
int get_index(const T &object) const;
|
int get_index(const T &object) const;
|
||||||
|
|
||||||
// Return true if T is in the array
|
|
||||||
bool contains(const T &object) const;
|
|
||||||
|
|
||||||
// Return true if the index is valid
|
// Return true if the index is valid
|
||||||
T contains_index(int index) const;
|
T contains_index(int index) const;
|
||||||
|
|
||||||
@ -632,12 +629,6 @@ int GenericVector<T>::get_index(const T &object) const {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return true if T is in the array
|
|
||||||
template <typename T>
|
|
||||||
bool GenericVector<T>::contains(const T &object) const {
|
|
||||||
return get_index(object) != -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add an element in the array
|
// Add an element in the array
|
||||||
template <typename T>
|
template <typename T>
|
||||||
int GenericVector<T>::push_back(T object) {
|
int GenericVector<T>::push_back(T object) {
|
||||||
|
@ -396,7 +396,8 @@ bool MasterTrainer::LoadFontInfo(const char *filename) {
|
|||||||
}
|
}
|
||||||
fontinfo.properties = (italic << 0) + (bold << 1) + (fixed << 2) +
|
fontinfo.properties = (italic << 0) + (bold << 1) + (fixed << 2) +
|
||||||
(serif << 3) + (fraktur << 4);
|
(serif << 3) + (fraktur << 4);
|
||||||
if (!fontinfo_table_.contains(fontinfo)) {
|
if (fontinfo_table_.get_index(fontinfo) < 0) {
|
||||||
|
// fontinfo not in table.
|
||||||
fontinfo_table_.push_back(fontinfo);
|
fontinfo_table_.push_back(fontinfo);
|
||||||
} else {
|
} else {
|
||||||
delete[] font_name;
|
delete[] font_name;
|
||||||
@ -434,10 +435,11 @@ bool MasterTrainer::LoadXHeights(const char *filename) {
|
|||||||
}
|
}
|
||||||
buffer[1023] = '\0';
|
buffer[1023] = '\0';
|
||||||
fontinfo.name = buffer;
|
fontinfo.name = buffer;
|
||||||
if (!fontinfo_table_.contains(fontinfo)) {
|
auto fontinfo_id = fontinfo_table_.get_index(fontinfo);
|
||||||
|
if (fontinfo_id < 0) {
|
||||||
|
// fontinfo not in table.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int fontinfo_id = fontinfo_table_.get_index(fontinfo);
|
|
||||||
xheights_[fontinfo_id] = xht;
|
xheights_[fontinfo_id] = xht;
|
||||||
total_xheight += xht;
|
total_xheight += xht;
|
||||||
++xheight_count;
|
++xheight_count;
|
||||||
|
Loading…
Reference in New Issue
Block a user