From 225702805234b3396daf89d6f95ee0abd8330194 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 23 Feb 2021 21:06:59 +0100 Subject: [PATCH] Replace GenericVector by std::vector in reject.cpp Signed-off-by: Stefan Weil --- src/ccmain/reject.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ccmain/reject.cpp b/src/ccmain/reject.cpp index e2df9f40..d7b7ac15 100644 --- a/src/ccmain/reject.cpp +++ b/src/ccmain/reject.cpp @@ -43,12 +43,13 @@ int16_t Tesseract::safe_dict_word(const WERD_RES *werd_res) { #include "docqual.h" #include "tesseractclass.h" -#include "genericvector.h" #include "helpers.h" +#include // for std::sort #include #include #include +#include // for std::vector namespace tesseract { @@ -230,12 +231,12 @@ float compute_reject_threshold(WERD_CHOICE* word) { float gapstart; // bottom of gap int blob_count = word->length(); - GenericVector ratings; - ratings.resize_no_init(blob_count); + std::vector ratings; + ratings.reserve(blob_count); for (int i = 0; i < blob_count; ++i) { - ratings[i] = word->certainty(i); + ratings.push_back(word->certainty(i)); } - ratings.sort(); + std::sort(ratings.begin(), ratings.end()); gapstart = ratings[0] - 1; // all reject if none better if (blob_count >= 3) { for (int index = 0; index < blob_count - 1; index++) {