swupd_cmds: Unecessary strlen used to compare.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
Otavio Pontes
2020-05-07 14:31:27 -07:00
parent 8d7a7dad6e
commit 8fb81bad0f
+1 -6
View File
@@ -72,14 +72,9 @@ static inline int subcmd_index(char *arg, struct subcmd *commands)
{
struct subcmd *entry = commands;
int i = 0;
size_t input_len;
size_t cmd_len;
input_len = str_len(arg);
while (entry->name != NULL) {
cmd_len = str_len(entry->name);
if (cmd_len == input_len && str_cmp(arg, entry->name) == 0) {
if (str_cmp(arg, entry->name) == 0) {
return i;
}
entry++;