Common/FileUtil: Make WriteStringToFile consistent with ReadFileToString

Makes the parameter ordering consistent and less error-prone.
This commit is contained in:
Lioncash
2019-05-28 17:45:36 -04:00
parent 992c8bfc4e
commit eb475025b8
6 changed files with 13 additions and 13 deletions

View File

@ -255,7 +255,7 @@ bool DownloadContent(const std::vector<TodoList::DownloadOp>& to_download,
std::optional<std::string> maybe_decompressed = GzipInflate(contents);
if (!maybe_decompressed)
return false;
std::string decompressed = std::move(*maybe_decompressed);
const std::string decompressed = std::move(*maybe_decompressed);
// Check that the downloaded contents have the right hash.
Manifest::Hash contents_hash = ComputeHash(decompressed);
@ -265,8 +265,8 @@ bool DownloadContent(const std::vector<TodoList::DownloadOp>& to_download,
return false;
}
std::string out = temp_path + DIR_SEP + hash_filename;
if (!File::WriteStringToFile(decompressed, out))
const std::string out = temp_path + DIR_SEP + hash_filename;
if (!File::WriteStringToFile(out, decompressed))
{
fprintf(log_fp, "Could not write cache file %s.\n", out.c_str());
return false;