Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
7a2c851d
Commit
7a2c851d
authored
6 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reorder some ifs, to reduce the average number of comparisons
parent
4d557489
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+11
-11
src/winio.c
with
11 additions
and
11 deletions
+11
-11
src/winio.c
View file @
7a2c851d
...
...
@@ -1508,20 +1508,20 @@ long get_unicode_kbinput(WINDOW *win, int kbinput)
* Ctrl-8 == Ctrl-? */
int
get_control_kbinput
(
int
kbinput
)
{
if
(
'@'
<=
kbinput
&&
kbinput
<=
'_'
)
return
kbinput
-
'@'
;
if
(
'`'
<=
kbinput
&&
kbinput
<=
'~'
)
return
kbinput
-
'`'
;
if
(
'3'
<=
kbinput
&&
kbinput
<=
'7'
)
return
kbinput
-
24
;
if
(
kbinput
==
'?'
||
kbinput
==
'8'
)
return
DEL_CODE
;
if
(
kbinput
==
' '
||
kbinput
==
'2'
)
return
0
;
else
if
(
kbinput
==
'/'
)
if
(
kbinput
==
'/'
)
return
31
;
else
if
(
'3'
<=
kbinput
&&
kbinput
<=
'7'
)
return
kbinput
-
24
;
else
if
(
kbinput
==
'8'
||
kbinput
==
'?'
)
return
DEL_CODE
;
else
if
(
'@'
<=
kbinput
&&
kbinput
<=
'_'
)
return
kbinput
-
'@'
;
else
if
(
'`'
<=
kbinput
&&
kbinput
<=
'~'
)
return
kbinput
-
'`'
;
else
return
kbinput
;
return
kbinput
;
}
/* Read in a stream of characters verbatim, and return the length of the
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help