Repository: microsoft/terminal
File: src/cascadia/TerminalSettingsEditor/ColorSchemesPageViewModel.cpp (C++)

Code before:
        L"Vintage",
        L"One Half Dark",
        L"One Half Light",
        L"Solarized Dark",
        L"Solarized Light",
        L"Tango Dark",
        L"Tango Light"
    };

    ColorSchemesPageViewModel::ColorSchemesPageViewModel(const Model::CascadiaSettings& settings) :
        _settings{ settings },
        _viewModelToSchemeMap{ winrt::single_threaded_map<Editor::ColorSchemeViewModel, Model::ColorScheme>() }
    {
        _MakeColorSchemeVMsHelper();
    }

    void ColorSchemesPageViewModel::UpdateSettings(const Model::CascadiaSettings& settings)
    {
        _settings = settings;

        // We want to re-initialize our AllColorSchemes list, but we want to make sure
        // we still have the same CurrentScheme as before (if that scheme still exists)

        // Store the name of the current scheme
        const auto hasCurrentScheme = HasCurrentScheme();
        const auto currentSchemeName = hasCurrentScheme ? CurrentScheme().Name() : hstring{ L"" };

        // Re-initialize the color scheme list
        _MakeColorSchemeVMsHelper();

        // Re-select the previously selected scheme if it exists
        if (hasCurrentScheme)
        {
            const auto it = _AllColorSchemes.First();
            while (it.HasCurrent())
            {
                auto scheme = *it;
                if (scheme.Name() == currentSchemeName)
                {
                    CurrentScheme(scheme);
                    break;
                }
                it.MoveNext();
            }
            if (!it.HasCurrent())
            {
                // we didn't find the previously selected scheme
                CurrentScheme(nullptr);
            }
        }
        else

Review comment (suggestion):
```suggestion
        const auto currentSchemeName = hasCurrentScheme ? CurrentScheme().Name() : hstring{};
```

prefer the nullary constructor instead of emitting an empty string constant

Code after:
        L"Vintage",
        L"One Half Dark",
        L"One Half Light",
        L"Solarized Dark",
        L"Solarized Light",
        L"Tango Dark",
        L"Tango Light"
    };

    ColorSchemesPageViewModel::ColorSchemesPageViewModel(const Model::CascadiaSettings& settings) :
        _settings{ settings },
        _viewModelToSchemeMap{ winrt::single_threaded_map<Editor::ColorSchemeViewModel, Model::ColorScheme>() }
    {
        _MakeColorSchemeVMsHelper();
    }

    void ColorSchemesPageViewModel::UpdateSettings(const Model::CascadiaSettings& settings)
    {
        _settings = settings;

        // We want to re-initialize our AllColorSchemes list, but we want to make sure
        // we still have the same CurrentScheme as before (if that scheme still exists)

        // Store the name of the current scheme
        const auto currentSchemeName = HasCurrentScheme() ? CurrentScheme().Name() : hstring{};

        // Re-initialize the color scheme list
        _MakeColorSchemeVMsHelper();

        // Re-select the previously selected scheme if it exists
        if (!currentSchemeName.empty())
        {
            const auto it = _AllColorSchemes.First();
            while (it.HasCurrent())
            {
                auto scheme = *it;
                if (scheme.Name() == currentSchemeName)
                {
                    CurrentScheme(scheme);
                    break;
                }
                it.MoveNext();
            }
            if (!it.HasCurrent())
            {
                // we didn't find the previously selected scheme
                CurrentScheme(nullptr);
            }
        }
        else
        {