Fix issue detected by Coverity Scan

CID: 1164533 (Logically dead code)

Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
This commit is contained in:
Noah Metzger 2018-08-01 10:27:11 +02:00
parent d4490af06d
commit 2d96c66126
3 changed files with 3 additions and 8 deletions

View File

@ -529,12 +529,7 @@ WERD_CHOICE& WERD_CHOICE::operator=(const WERD_CHOICE& source) {
// to get the target positions. If small_caps is true, sub/super are not
// considered, but dropcaps are.
// NOTE: blobs_list should be the chopped_word blobs. (Fully segemented.)
void WERD_CHOICE::SetScriptPositions(bool small_caps, TWERD* word) {
// Since WERD_CHOICE isn't supposed to depend on a Tesseract,
// we don't have easy access to the flags Tesseract stores. Therefore, debug
// for this module is hard compiled in.
int debug = 0;
void WERD_CHOICE::SetScriptPositions(bool small_caps, TWERD* word, int debug) {
// Initialize to normal.
for (int i = 0; i < length_; ++i)
script_pos_[i] = tesseract::SP_NORMAL;

View File

@ -552,7 +552,7 @@ class WERD_CHOICE : public ELIST_LINK {
// to get the target positions. If small_caps is true, sub/super are not
// considered, but dropcaps are.
// NOTE: blobs_list should be the chopped_word blobs. (Fully segemented.)
void SetScriptPositions(bool small_caps, TWERD* word);
void SetScriptPositions(bool small_caps, TWERD* word, int debug = 0);
// Sets the script_pos_ member from some source positions with a given length.
void SetScriptPositions(const tesseract::ScriptPos* positions, int length);
// Sets all the script_pos_ positions to the given position.

View File

@ -1284,7 +1284,7 @@ void LanguageModel::UpdateBestChoice(
return;
}
if (word_res->chopped_word != nullptr && !word_res->chopped_word->blobs.empty())
word->SetScriptPositions(false, word_res->chopped_word);
word->SetScriptPositions(false, word_res->chopped_word, language_model_debug_level);
// Update and log new raw_choice if needed.
if (word_res->raw_choice == nullptr ||
word->rating() < word_res->raw_choice->rating()) {