Hygiene: get rid of all instances of hstring ctor'd with L"" (#17655)

One of these things can be optimized. It's not the one you thought.
This commit is contained in:
Dustin L. Howett 2024-08-06 16:41:21 -05:00 committed by GitHub
parent dfb52331f8
commit 07c7167535
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 25 additions and 25 deletions

View File

@ -1448,8 +1448,8 @@ namespace winrt::TerminalApp::implementation
const auto source = realArgs.Source();
std::vector<Command> commandsCollection;
Control::CommandHistoryContext context{ nullptr };
winrt::hstring currentCommandline = L"";
winrt::hstring currentWorkingDirectory = L"";
winrt::hstring currentCommandline;
winrt::hstring currentWorkingDirectory;
// If the user wanted to use the current commandline to filter results,
// OR they wanted command history (or some other source that
@ -1479,7 +1479,7 @@ namespace winrt::TerminalApp::implementation
context.QuickFixes() != nullptr)
{
// \ue74c --> OEM icon
const auto recentCommands = Command::HistoryToCommands(context.QuickFixes(), hstring{ L"" }, false, hstring{ L"\ue74c" });
const auto recentCommands = Command::HistoryToCommands(context.QuickFixes(), hstring{}, false, hstring{ L"\ue74c" });
for (const auto& t : recentCommands)
{
commandsCollection.push_back(t);

View File

@ -153,8 +153,8 @@ namespace winrt::TerminalApp::implementation
winrt::fire_and_forget ProcessStartupActions(Windows::Foundation::Collections::IVector<Microsoft::Terminal::Settings::Model::ActionAndArgs> actions,
const bool initial,
const winrt::hstring cwd = L"",
const winrt::hstring env = L"");
const winrt::hstring cwd = winrt::hstring{},
const winrt::hstring env = winrt::hstring{});
TerminalApp::WindowProperties WindowProperties() const noexcept { return _WindowProperties; };

View File

@ -2289,7 +2289,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const auto trimmed = s.substr(0, strEnd + 1);
return winrt::hstring{ trimmed };
}
return winrt::hstring{ L"" };
return {};
};
const auto currentCommand = _terminal->CurrentCommand();

View File

@ -319,7 +319,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
}
return L"";
return {};
}
hstring TermControlAutomationPeer::GetHelpTextCore() const
@ -328,7 +328,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
return control->Title();
}
return L"";
return {};
}
AutomationLiveSetting TermControlAutomationPeer::GetLiveSettingCore() const

View File

@ -884,7 +884,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
bool AppearanceViewModel::BackgroundImageSettingsVisible()
{
return BackgroundImagePath() != L"";
return !BackgroundImagePath().empty();
}
void AppearanceViewModel::ClearColorScheme()

View File

@ -344,7 +344,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
winrt::hstring ActionAndArgs::GenerateName() const
{
// Sentinel used to indicate this command must ALWAYS be generated by GenerateName
static const winrt::hstring MustGenerate{ L"" };
static const winrt::hstring MustGenerate;
// Use a magic static to initialize this map, because we won't be able
// to load the resources at _init_, only at runtime.
static const auto GeneratedActionNames = []() {
@ -453,7 +453,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
}
const auto found = GeneratedActionNames.find(_Action);
return found != GeneratedActionNames.end() ? found->second : L"";
return found != GeneratedActionNames.end() ? found->second : winrt::hstring{};
}
// Function Description:
@ -483,7 +483,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
}
return winrt::hstring{ result };
}
return L"";
return {};
}
winrt::hstring ActionAndArgs::Serialize(const winrt::Windows::Foundation::Collections::IVector<Model::ActionAndArgs>& args)

View File

@ -116,7 +116,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
auto s = ss.str();
if (s.empty())
{
return L"";
return {};
}
// Chop off the last ", "
@ -187,7 +187,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
auto s = ss.str();
if (s.empty())
{
return L"";
return {};
}
// Chop off the last " "
@ -536,7 +536,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
SchemeName().c_str())
};
}
return L"";
return {};
}
winrt::hstring SetTabColorArgs::GenerateName() const
@ -579,7 +579,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
Commandline().c_str())
};
}
return L"";
return {};
}
winrt::hstring CloseOtherTabsArgs::GenerateName() const
@ -765,7 +765,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
case FindMatchDirection::Previous:
return winrt::hstring{ RS_(L"FindPrevCommandKey") };
}
return L"";
return {};
}
winrt::hstring NewWindowArgs::GenerateName() const
@ -841,7 +841,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// We couldn't parse a URL out of this. Return no string at all, so that
// we don't even put this into the command palette.
return L"";
return {};
}
winrt::hstring GlobalSummonArgs::GenerateName() const
@ -909,12 +909,12 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
}
// Return the empty string - the Clear() should be one of these values
return winrt::hstring{ L"" };
return {};
}
winrt::hstring MultipleActionsArgs::GenerateName() const
{
return L"";
return {};
}
winrt::hstring AdjustOpacityArgs::GenerateName() const
@ -968,7 +968,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
return winrt::hstring{ ss.str() };
}
return L"";
return {};
}
static winrt::hstring _FormatColorString(const Control::SelectionColor& selectionColor)
@ -1095,7 +1095,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
case SelectOutputDirection::Previous:
return RS_(L"SelectOutputPreviousCommandKey");
}
return L"";
return {};
}
winrt::hstring SelectCommandArgs::GenerateName() const
{
@ -1106,6 +1106,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
case SelectOutputDirection::Previous:
return RS_(L"SelectCommandPreviousCommandKey");
}
return L"";
return {};
}
}

View File

@ -148,7 +148,7 @@ winrt::hstring AppearanceConfig::ExpandedBackgroundImagePath()
}
else
{
return winrt::hstring{ L"" };
return {};
}
}
else

View File

@ -52,7 +52,7 @@ namespace winrt::Microsoft::Terminal::UI::implementation
winrt::hstring Converters::StringOrEmptyIfPlaceholder(const winrt::hstring& placeholder, const winrt::hstring& value)
{
return placeholder == value ? L"" : value;
return placeholder == value ? winrt::hstring{} : value;
}
// Misc