@@ -65,46 +65,30 @@ PanelPosition CPluginProxy::otherPanel() const
65
65
PanelState& CPluginProxy::panelState (const PanelPosition panel)
66
66
{
67
67
static PanelState empty;
68
- if (panel == PluginUnknownPanel)
68
+ if (panel == PluginUnknownPanel) [[unlikely]]
69
69
{
70
70
assert_unconditional_r (" Unknown panel" );
71
71
empty = PanelState ();
72
72
return empty;
73
73
}
74
74
75
- const auto state = _panelState.find (panel);
76
- if (state == _panelState.end ())
77
- {
78
- assert_unconditional_r (" Unknown panel" );
79
- empty = PanelState ();
80
- return empty;
81
- }
82
- else
83
- return state->second ;
75
+ return _panelState[panel];
84
76
}
85
77
86
78
const PanelState & CPluginProxy::panelState (const PanelPosition panel) const
87
79
{
88
- static const PanelState empty {};
89
- if (panel == PluginUnknownPanel)
90
- {
80
+ static const PanelState empty;
81
+ if (panel == PluginUnknownPanel) [[unlikely]]
91
82
return empty;
92
- }
93
83
94
- const auto state = _panelState.find (panel);
95
- assert_and_return_r (state != _panelState.end (), empty);
96
-
97
- return state->second ;
84
+ return _panelState[panel];
98
85
}
99
86
100
87
QString CPluginProxy::currentFolderPathForPanel (const PanelPosition panel) const
101
88
{
102
89
assert_and_return_r (panel != PluginUnknownPanel, QString ());
103
90
104
- const auto state = _panelState.find (panel);
105
- assert_and_return_r (state != _panelState.end (), QString ());
106
-
107
- return state->second .currentFolder ;
91
+ return _panelState[panel].currentFolder ;
108
92
}
109
93
110
94
QString CPluginProxy::currentItemPathForPanel (const PanelPosition panel) const
0 commit comments