mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
Avoid redundant conversion from std::string to char * to std::string
This fixes two issues reported by Codacy. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
5712e16957
commit
6e73a80e10
@ -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