Repository: microsoft/terminal
File: src/cascadia/TerminalSettingsModel/Profile.cpp (C++)

Code before:
    _Guid(guid)
{
}

void Profile::CreateUnfocusedAppearance()
{
    if (!_UnfocusedAppearance)
    {
        auto unfocusedAppearance{ winrt::make_self<implementation::AppearanceConfig>(weak_ref<Model::Profile>(*this)) };

        // If an unfocused appearance is defined in this profile, any undefined parameters are
        // taken from this profile's default appearance, so add it as a parent
        com_ptr<AppearanceConfig> parentCom;
        parentCom.copy_from(winrt::get_self<implementation::AppearanceConfig>(_DefaultAppearance));
        unfocusedAppearance->InsertParent(parentCom);

        _UnfocusedAppearance = *unfocusedAppearance;
    }
}

void Profile::DeleteUnfocusedAppearance()
{
    if (_UnfocusedAppearance)
    {
        _UnfocusedAppearance = std::nullopt;
    }
}

winrt::com_ptr<Profile> Profile::CopySettings(winrt::com_ptr<Profile> source)
{
    auto profile{ winrt::make_self<Profile>() };

    profile->_Guid = source->_Guid;
    profile->_Name = source->_Name;
    profile->_Source = source->_Source;
    profile->_Hidden = source->_Hidden;
    profile->_Icon = source->_Icon;
    profile->_CloseOnExit = source->_CloseOnExit;
    profile->_TabTitle = source->_TabTitle;
    profile->_TabColor = source->_TabColor;
    profile->_SuppressApplicationTitle = source->_SuppressApplicationTitle;
    profile->_UseAcrylic = source->_UseAcrylic;
    profile->_AcrylicOpacity = source->_AcrylicOpacity;
    profile->_ScrollState = source->_ScrollState;
    profile->_FontFace = source->_FontFace;
    profile->_FontSize = source->_FontSize;
    profile->_FontWeight = source->_FontWeight;
    profile->_Padding = source->_Padding;
    profile->_Commandline = source->_Commandline;
    profile->_StartingDirectory = source->_StartingDirectory;
    profile->_AntialiasingMode = source->_AntialiasingMode;

Review comment (suggestion):
```suggestion
    _UnfocusedAppearance = std::nullopt;
```

Code after:
{
}

void Profile::CreateUnfocusedAppearance()
{
    if (!_UnfocusedAppearance)
    {
        auto unfocusedAppearance{ winrt::make_self<implementation::AppearanceConfig>(weak_ref<Model::Profile>(*this)) };

        // If an unfocused appearance is defined in this profile, any undefined parameters are
        // taken from this profile's default appearance, so add it as a parent
        com_ptr<AppearanceConfig> parentCom;
        parentCom.copy_from(winrt::get_self<implementation::AppearanceConfig>(_DefaultAppearance));
        unfocusedAppearance->InsertParent(parentCom);

        _UnfocusedAppearance = *unfocusedAppearance;
    }
}

void Profile::DeleteUnfocusedAppearance()
{
    _UnfocusedAppearance = std::nullopt;
}

winrt::com_ptr<Profile> Profile::CopySettings(winrt::com_ptr<Profile> source)
{
    auto profile{ winrt::make_self<Profile>() };

    profile->_Guid = source->_Guid;
    profile->_Name = source->_Name;
    profile->_Source = source->_Source;
    profile->_Hidden = source->_Hidden;
    profile->_Icon = source->_Icon;
    profile->_CloseOnExit = source->_CloseOnExit;
    profile->_TabTitle = source->_TabTitle;
    profile->_TabColor = source->_TabColor;
    profile->_SuppressApplicationTitle = source->_SuppressApplicationTitle;
    profile->_UseAcrylic = source->_UseAcrylic;
    profile->_AcrylicOpacity = source->_AcrylicOpacity;
    profile->_ScrollState = source->_ScrollState;
    profile->_Padding = source->_Padding;
    profile->_Commandline = source->_Commandline;
    profile->_StartingDirectory = source->_StartingDirectory;
    profile->_AntialiasingMode = source->_AntialiasingMode;
    profile->_ForceFullRepaintRendering = source->_ForceFullRepaintRendering;
    profile->_SoftwareRendering = source->_SoftwareRendering;
    profile->_HistorySize = source->_HistorySize;
    profile->_SnapOnInput = source->_SnapOnInput;
    profile->_AltGrAliasing = source->_AltGrAliasing;
    profile->_BellStyle = source->_BellStyle;
    profile->_ConnectionType = source->_ConnectionType;