Skip to content

Commit 406312f

Browse files
fix loops
1 parent 625753c commit 406312f

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/cascadia/TerminalSettingsModel/ActionMap.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,12 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
7070
winrt::com_ptr<implementation::ActionMap> foundParent{ nullptr };
7171
for (const auto& parent : _parents)
7272
{
73-
for (const auto& [_, cmd] : parent->_ActionMap)
73+
const auto parentMap = parent->_ActionMap;
74+
if (parentMap.begin() != parentMap.end() && parentMap.begin()->second.Origin() == OriginTag::InBox)
7475
{
75-
if (cmd.Origin() != OriginTag::InBox)
76-
{
77-
// only one parent contains all the inbox actions and that parent contains only inbox actions,
78-
// so if we found a non-inbox action we can just skip to the next parent
79-
break;
80-
}
76+
// only one parent contains all the inbox actions and that parent contains only inbox actions,
77+
// so if we found an inbox action we know this is the parent we are looking for
8178
foundParent = parent;
82-
}
83-
84-
if (foundParent)
85-
{
8679
break;
8780
}
8881
}

0 commit comments

Comments
 (0)