Changing CCalcEngine::s_engineStrings to use string_view for keys (#829)
This commit is contained in:
committed by
Matt Cooley
parent
25d7a46ac1
commit
369843dd37
@@ -17,7 +17,7 @@ namespace CalculatorApp
|
||||
m_resLoader = ResourceLoader::GetForViewIndependentUse("CEngineStrings");
|
||||
}
|
||||
|
||||
wstring EngineResourceProvider::GetCEngineString(const wstring& id)
|
||||
wstring EngineResourceProvider::GetCEngineString(wstring_view id)
|
||||
{
|
||||
const auto& localizationSettings = LocalizationSettings::GetInstance();
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CalculatorApp
|
||||
return numberGroupingString;
|
||||
}
|
||||
|
||||
StringReference idRef(id.c_str());
|
||||
StringReference idRef(id.data(), id.length());
|
||||
String ^ str = m_resLoader->GetString(idRef);
|
||||
return str->Begin();
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ namespace CalculatorApp
|
||||
{
|
||||
public:
|
||||
EngineResourceProvider();
|
||||
virtual std::wstring GetCEngineString(const std::wstring& id) override;
|
||||
virtual std::wstring GetCEngineString(std::wstring_view id) override;
|
||||
|
||||
private:
|
||||
Windows::ApplicationModel::Resources::ResourceLoader ^ m_resLoader;
|
||||
|
Reference in New Issue
Block a user