-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some issues which were reported by Codacy #4266
Conversation
Signed-off-by: Stefan Weil <[email protected]>
Apply also some smaller optimizations and add TODO comments for local variables which require further examination. Signed-off-by: Stefan Weil <[email protected]>
According to Codacy this pull request fixes about 32 issues (from a total of currently 590 issues), so much more work remains to be done. |
Is it possible to use auto in more places? |
while (page_res_it.word() != nullptr && page_res_it.block() == current_block) { | ||
current_row = page_res_it.row(); | ||
ROW_RES *current_row = page_res_it.row(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto?
@@ -539,7 +533,7 @@ void Tesseract::tilde_delete(PAGE_RES_IT &page_res_it) { | |||
|
|||
page_res_it.restart_page(); | |||
while (page_res_it.word() != nullptr) { | |||
word = page_res_it.word(); | |||
WERD_RES *word = page_res_it.word(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto?
@@ -183,7 +182,7 @@ void Tesseract::fix_fuzzy_space_list(WERD_RES_LIST &best_perm, ROW *row, BLOCK * | |||
|
|||
while ((best_score != PERFECT_WERDS) && !current_perm.empty()) { | |||
match_current_words(current_perm, row, block); | |||
current_score = eval_word_spacing(current_perm); | |||
int16_t current_score = eval_word_spacing(current_perm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto?
WERD_RES *new_wd; | ||
|
||
for (src_it.mark_cycle_pt(); !src_it.cycled_list(); src_it.forward()) { | ||
src_wd = src_it.data(); | ||
WERD_RES *src_wd = src_it.data(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto?
Yes, sure, but sometimes I want to be able to see the data types explicitly for myself, and in other cases more work is needed to verify that Maybe some tools can |
No description provided.