Simplify re: lenormf

This commit is contained in:
Jay McCarthy 2018-11-30 05:47:31 -05:00
parent 4cac29d98c
commit f36a2870b8

View File

@ -670,14 +670,14 @@ Optional<Key> NCursesUI::get_next_key()
case '1': case '1':
{ {
const Codepoint c2 = wgetch(m_window); const Codepoint c2 = wgetch(m_window);
if ( c2 != ';' ) if (c2 != ';')
{ {
ungetch(c2); ungetch(c1); ungetch(c2); ungetch(c1);
break; break;
} }
const Codepoint c3 = wgetch(m_window); const Codepoint c3 = wgetch(m_window);
function<Key(Key)> f = nullptr; function<Key(Key)> f;
switch (c3) switch (c3)
{ {
case '2': f = shift; break; case '2': f = shift; break;
@ -688,7 +688,7 @@ Optional<Key> NCursesUI::get_next_key()
case '7': f = alt_ctrl; break; case '7': f = alt_ctrl; break;
case '8': f = shift_alt_ctrl; break; case '8': f = shift_alt_ctrl; break;
} }
if ( f == nullptr ) if (f)
{ {
ungetch(c3); ungetch(c2); ungetch(c1); ungetch(c3); ungetch(c2); ungetch(c1);
break; break;