Skip to content

Commit 154c836

Browse files
committed
Apply refactoring suggested by @FreeZoneMods
1 parent adc9937 commit 154c836

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/xrGame/xr_level_controller.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ void initialize_bindings()
3737

3838
void remap_keys()
3939
{
40-
int idx = 0;
4140
string128 buff;
4241
// Log("Keys remap:");
43-
while (keyboards[idx].key_name)
42+
for (int idx = 0; keyboards[idx].key_name; ++idx)
4443
{
4544
buff[0] = 0;
4645
_keyboard& kb = keyboards[idx];
47-
const bool res = pInput->get_dik_name(kb.dik, buff, sizeof(buff));
48-
if (res)
46+
if (pInput->get_dik_name(kb.dik, buff, sizeof(buff)))
4947
kb.key_local_name = buff;
5048
else
5149
{
@@ -55,7 +53,6 @@ void remap_keys()
5553
}
5654

5755
// Msg("[%s]-[%s]", kb.key_name, kb.key_local_name.c_str());
58-
++idx;
5956
}
6057
}
6158

0 commit comments

Comments
 (0)