mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-04 01:39:16 +08:00
Merge pull request #4249 from stweil/codacy
Avoid redundant conversion from std::string to char * to std::string
This commit is contained in:
commit
ea82f919a6
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user