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:
Stefan Weil 2024-05-23 17:13:12 +02:00
parent 5712e16957
commit 6e73a80e10
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,