Skip to content

Commit

Permalink
fmt is smart
Browse files Browse the repository at this point in the history
  • Loading branch information
PankajBhojwani committed Apr 12, 2024
1 parent aa49212 commit 5ee630e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// there is a _tiny_ chance of collision because of the truncate but unlikely for
// the number of commands a user is expected to have
const auto argsHash32 = static_cast<uint32_t>(_Args.Hash() & 0xFFFFFFFF);
std::wstringstream stream;
stream << std::hex << std::uppercase << argsHash32;
const auto argsHash32InHex = stream.str();
fmt::format_to(std::back_inserter(result), L".{}", argsHash32InHex);
// {0:X} formats the truncated hash to an uppercase hex string
fmt::format_to(std::back_inserter(result), L".{0:X}", argsHash32);
}
return winrt::hstring{ result };
}
Expand Down

0 comments on commit 5ee630e

Please sign in to comment.