Here, I do not quite understand: Why did not directly break it, because at the end of the function, there implementation: 'event.Skip ();' ?
Yes, but there are computations in between which can be avoided. Namely event.GetKeyCode(); and the switch computation.
Sorry, I still do not quite understand.
If change the code like this:
void cbStyledTextCtrl::OnKeyUp(wxKeyEvent& event)
{
if (!AllowTabSmartJump())
{
event.Skip();
return;
}
const int keyCode = event.GetKeyCode();
switch (keyCode)
{
...
}
event.Skip();
}
We do not have access to ‘event.GetKeyCode()’ value and 'switch’ calculation, BUT, we need call 'AllowTabSmartJump' each time.
Here, the time occupied may be greater.