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
9322e1e6
Commit
9322e1e6
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle two ifs for a little more speed
Saving roughly twenty microseconds at startup.
parent
b70fe38e
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/global.c
+7
-8
src/global.c
with
7 additions
and
8 deletions
+7
-8
src/global.c
View file @
9322e1e6
...
...
@@ -406,18 +406,17 @@ void assign_keyinfo(sc *s, const char *keystring)
assert
(
strlen
(
keystring
)
>
1
&&
(
!
s
->
meta
||
strlen
(
keystring
)
>
2
));
if
(
keystring
[
0
]
==
'^'
)
if
(
keystring
[
0
]
==
'^'
)
{
s
->
keycode
=
s
->
keystr
[
1
]
-
64
;
else
if
(
s
->
meta
)
if
(
strcasecmp
(
keystring
,
"^Space"
)
==
0
)
s
->
keycode
=
0
;
}
else
if
(
s
->
meta
)
{
s
->
keycode
=
tolower
((
int
)
s
->
keystr
[
2
]);
else
if
(
keystring
[
0
]
==
'F'
)
if
(
strcasecmp
(
keystring
,
"M-Space"
)
==
0
)
s
->
keycode
=
(
int
)
' '
;
}
else
if
(
keystring
[
0
]
==
'F'
)
s
->
keycode
=
KEY_F0
+
atoi
(
&
s
->
keystr
[
1
]);
/* Catch the strings that don't bind as easily as we'd like. */
if
(
strcasecmp
(
s
->
keystr
,
"^Space"
)
==
0
)
s
->
keycode
=
0
;
else
if
(
strcasecmp
(
s
->
keystr
,
"M-Space"
)
==
0
)
s
->
keycode
=
(
int
)
' '
;
else
if
(
!
strcasecmp
(
s
->
keystr
,
"Up"
))
s
->
keycode
=
KEY_UP
;
else
if
(
!
strcasecmp
(
s
->
keystr
,
"Down"
))
...
...
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