Skip to content

Commit

Permalink
Merge pull request tesseract-ocr#4249 from stweil/codacy
Browse files Browse the repository at this point in the history
Avoid redundant conversion from std::string to char * to std::string
  • Loading branch information
egorpugin authored May 23, 2024
2 parents 5712e16 + 6e73a80 commit ea82f91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/training/unicharset/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ bool File::Readable(const std::string &filename) {
}

bool File::ReadFileToString(const std::string &filename, std::string *out) {
FILE *stream = File::Open(filename.c_str(), "rb");
FILE *stream = File::Open(filename, "rb");
if (stream == nullptr) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/training/unicharset/lang_model_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ bool WriteRecoder(const UNICHARSET &unicharset, bool pass_through, const std::st
std::string suffix;
suffix += ".charset_size=" + std::to_string(recoder.code_range());
suffix += ".txt";
return WriteFile(output_dir, lang, suffix.c_str(), recoder_data, writer);
return WriteFile(output_dir, lang, suffix, recoder_data, writer);
}

// Helper builds a dawg from the given words, using the unicharset as coding,
Expand Down

0 comments on commit ea82f91

Please sign in to comment.