mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-23 18:49:08 +08:00
Fixes #4247: remove unnecessary nullptr checks
This commit is contained in:
parent
5d5a633a5d
commit
cf7231f370
@ -899,14 +899,11 @@ void RecodeBeamSearch::ContinueContext(
|
||||
bool use_dawgs = IsDawgFromBeamsIndex(index);
|
||||
NodeContinuation prev_cont = ContinuationFromBeamsIndex(index);
|
||||
for (int p = length - 1; p >= 0; --p, previous = previous->prev) {
|
||||
while (previous != nullptr &&
|
||||
(previous->duplicate || previous->code == null_char_)) {
|
||||
while (previous->duplicate || previous->code == null_char_) {
|
||||
previous = previous->prev;
|
||||
}
|
||||
if (previous != nullptr) {
|
||||
prefix.Set(p, previous->code);
|
||||
full_code.Set(p, previous->code);
|
||||
}
|
||||
prefix.Set(p, previous->code);
|
||||
full_code.Set(p, previous->code);
|
||||
}
|
||||
if (prev != nullptr && !is_simple_text_) {
|
||||
if (top_n_flags_[prev->code] == top_n_flag) {
|
||||
|
Loading…
Reference in New Issue
Block a user