Changing CCalcEngine::s_engineStrings to use string_view for keys (#829)
This commit is contained in:
committed by
Matt Cooley
parent
25d7a46ac1
commit
369843dd37
@@ -24,17 +24,16 @@ static constexpr wstring_view DEFAULT_NUMBER_STR = L"0";
|
||||
// Read strings for keys, errors, trig types, etc.
|
||||
// These will be copied from the resources to local memory.
|
||||
|
||||
unordered_map<wstring, wstring> CCalcEngine::s_engineStrings;
|
||||
unordered_map<wstring_view, wstring> CCalcEngine::s_engineStrings;
|
||||
|
||||
void CCalcEngine::LoadEngineStrings(CalculationManager::IResourceProvider& resourceProvider)
|
||||
{
|
||||
for (const auto& sid : g_sids)
|
||||
{
|
||||
auto locKey = wstring{ sid };
|
||||
auto locString = resourceProvider.GetCEngineString(locKey);
|
||||
auto locString = resourceProvider.GetCEngineString(sid);
|
||||
if (!locString.empty())
|
||||
{
|
||||
s_engineStrings[locKey] = locString;
|
||||
s_engineStrings[sid] = locString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user