Merge pull request #4249 from stweil/codacy

Avoid redundant conversion from std::string to char * to std::string
This commit is contained in:
Egor Pugin 2024-05-24 01:15:03 +03:00 committed by GitHub
commit ea82f919a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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,