Skip to content

Commit b82e3ba

Browse files
author
hannemann
committed
simplified sending of strings
Massive performance boost, special thanks to Lars ;)
1 parent 9f59b53 commit b82e3ba

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

remote.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,19 @@ bool KeyPairList::hitKey(string key, const cxxtools::Char* kbd)
123123
key[i] = tolower(key[i]);
124124
}
125125

126+
if ( key == "kbd" ) {
127+
std::size_t n = 0;
128+
while (kbd[n]) {
129+
cRemote::Put(KBDKEY(kbd[n]));
130+
++n;
131+
}
132+
return true;
133+
}
134+
135+
126136
for (int i=0;i<(int)keys.size();i++)
127137
{
128138
if (string(keys[i].str) == key) {
129-
if ( key == "kbd" ) {
130-
static const cxxtools::Char term(0);
131-
std::size_t n = 0;
132-
while( kbd[n] != term ) {
133-
cRemote::Put(KBDKEY(kbd[n]));
134-
++n;
135-
}
136-
return true;
137-
}
138139
cRemote::Put(keys[i].key);
139140
return true;
140141
}

0 commit comments

Comments
 (0)