Skip to content

Commit

Permalink
Optimize loop with the most common case of pressedKey == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
merces committed Apr 20, 2023
1 parent 53c9b57 commit 639f3e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Hashes/HiewModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ int HEM_API Hem_EntryPoint(HEMCALL_TAG* HemCall) {
HEM_UINT pressedFnKey;

int item = 1; // Just a reminder menu items start at 1 (not 0)
while (item = HiewGate_Menu(HEM_MODULE_FULL_NAME, lines, _countof(lines), HASHES_SHA256_STR_LEN, item, &fnKeys, &pressedFnKey, NULL, NULL)) {
while (item = HiewGate_Menu(HEM_MODULE_FULL_NAME, lines, _countof(lines), HASH_SHA256_STR_LEN, item, &fnKeys, &pressedFnKey, NULL, NULL)) {
if (!pressedFnKey)
continue;

switch (pressedFnKey) {
case HEM_FNKEY_F1:
ShowHelp();
Expand Down

0 comments on commit 639f3e9

Please sign in to comment.