Skip to content

Conversation

stweil
Copy link
Member

@stweil stweil commented Jun 11, 2024

No description provided.

stweil added 2 commits June 11, 2024 15:55
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Apply also some smaller optimizations and add TODO comments
for local variables which require further examination.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil
Copy link
Member Author

stweil commented Jun 11, 2024

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.

@egorpugin
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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);
Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto?

@stweil
Copy link
Member Author

stweil commented Jun 11, 2024

Is it possible to use auto in more places?

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 auto or auto * really gives the same result.

Maybe some tools can auto-fy the code automatically. Then we could consider using such tools in separate commits.

@stweil stweil merged commit 96772c5 into tesseract-ocr:main Jun 11, 2024
@stweil stweil deleted the codacy branch June 11, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants