1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

command: replace strcmp with enum

Here we already know 'enum' value, so compare
just those instead of calling strcmp().
This commit is contained in:
Zdenek Kabelac 2024-05-12 17:12:19 +02:00
parent 1a219c69ee
commit fd8ed7554e

View File

@ -1184,7 +1184,7 @@ void factor_common_options(void)
for (ci = 0; ci < COMMAND_COUNT; ci++) { for (ci = 0; ci < COMMAND_COUNT; ci++) {
cmd = &commands[ci]; cmd = &commands[ci];
if (strcmp(cmd->name, command_names[cn].name)) if (cmd->lvm_command_enum != command_names[cn].lvm_command_enum)
continue; continue;
command_names_args[cn].variants++; command_names_args[cn].variants++;
@ -1195,7 +1195,7 @@ void factor_common_options(void)
for (ci = 0; ci < COMMAND_COUNT; ci++) { for (ci = 0; ci < COMMAND_COUNT; ci++) {
cmd = &commands[ci]; cmd = &commands[ci];
if (strcmp(cmd->name, command_names[cn].name)) if (cmd->lvm_command_enum != command_names[cn].lvm_command_enum)
continue; continue;
if (cmd->ro_count || cmd->any_ro_count) if (cmd->ro_count || cmd->any_ro_count)