mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 12:00:17 +02:00
XXFileHash: Drop unnecessary use of value_or
This commit is contained in:
1 parent
4f605739f1
commit
135477e539
1 file changed
+5
-5
@@ -749,13 +749,13 @@ bool ValidateCheckExists(const WebFileFetcher::FileTargets& Target) {
|
||||
|
||||
auto Res = XXFileHash::HashFile(PathName);
|
||||
if (Result == 0) {
|
||||
if (Res.value_or(0) == ExpectedHash) {
|
||||
if (Res == ExpectedHash) {
|
||||
fextl::string Text = fextl::fmt::format("{} matches expected hash. Skipping download", filename);
|
||||
ExecWithInfo(Text);
|
||||
return false;
|
||||
}
|
||||
} else if (Result == 1) {
|
||||
if (Res.value_or(0) != ExpectedHash) {
|
||||
if (Res != ExpectedHash) {
|
||||
return AskForConfirmation("RootFS doesn't match hash!\nDo you want to redownload?");
|
||||
} else {
|
||||
fextl::string Text = fextl::fmt::format("{} matches expected hash", filename);
|
||||
@@ -907,12 +907,12 @@ bool ValidateCheckExists(const WebFileFetcher::FileTargets& Target) {
|
||||
fmt::print("Validating RootFS hash...\n");
|
||||
auto Res = XXFileHash::HashFile(PathName);
|
||||
if (Result == 0) {
|
||||
if (Res.value_or(0) == ExpectedHash) {
|
||||
if (Res == ExpectedHash) {
|
||||
fmt::print("{} matches expected hash. Skipping downloading\n", filename);
|
||||
return false;
|
||||
}
|
||||
} else if (Result == 1) {
|
||||
if (Res.value_or(0) != ExpectedHash) {
|
||||
if (Res != ExpectedHash) {
|
||||
fmt::print("RootFS doesn't match hash!\n");
|
||||
return AskForConfirmation("Do you want to redownload?");
|
||||
} else {
|
||||
@@ -1178,7 +1178,7 @@ int main(int argc, char** argv, char** const envp) {
|
||||
|
||||
if (std::filesystem::exists(PathName, ec)) {
|
||||
auto Res = XXFileHash::HashFile(PathName);
|
||||
if (Res.value_or(0) != ExpectedHash) {
|
||||
if (Res != ExpectedHash) {
|
||||
fextl::string Text = fextl::fmt::format("Couldn't hash the rootfs or hash didn't match\n");
|
||||
Text += fmt::format("Hash {:x} != Expected Hash {:x}\n", Res.value_or(0), ExpectedHash);
|
||||
ExecWithInfo(Text);
|
||||
|
||||
Reference in new issue
Block a user