Avoid useless loop by moving check to the default case
This commit is contained in:
1 parent
b314d1ef1c
commit
8543db11b5
1 file changed
+7
-8
@@ -1264,13 +1264,6 @@ void annotateMfPlus(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
|||||||
data_size = cmdsize - (data - cmd);
|
data_size = cmdsize - (data - cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Messages for commands that do not need args are treated first
|
|
||||||
const char *annotation = mfpGetAnnotationForCode(cmd[pos]) ;
|
|
||||||
if (annotation != NULL) {
|
|
||||||
snprintf(exp, size, "%s", annotation) ;
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (cmd[pos]) {
|
switch (cmd[pos]) {
|
||||||
case MFP_AUTHENTICATEFIRST:
|
case MFP_AUTHENTICATEFIRST:
|
||||||
case MFP_AUTHENTICATEFIRST_VARIANT:
|
case MFP_AUTHENTICATEFIRST_VARIANT:
|
||||||
@@ -1407,7 +1400,13 @@ void annotateMfPlus(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
found_annotation = false;
|
// Messages for commands that do not need args are treated here
|
||||||
|
const char *annotation = mfpGetAnnotationForCode(cmd[pos]) ;
|
||||||
|
if (annotation != NULL) {
|
||||||
|
snprintf(exp, size, "%s", annotation) ;
|
||||||
|
} else {
|
||||||
|
found_annotation = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (found_annotation) {
|
if (found_annotation) {
|
||||||
|
|||||||
Reference in new issue
Block a user