1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

Optimize second call to strchr with same parameters

Small optimalization - reusing already known strchr result.
This commit is contained in:
Zdenek Kabelac 2010-12-01 10:36:25 +00:00
parent a2f563f84f
commit a200f50bbe

View File

@ -214,6 +214,7 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv,
for (; opt < argc; opt++) {
const char *lv_name = argv[opt];
const char *tmp_lv_name;
char *vgname_def;
unsigned dev_dir_found = 0;
@ -246,9 +247,9 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv,
continue;
}
lv_name = vgname;
if (strchr(vgname, '/')) {
if ((tmp_lv_name = strchr(vgname, '/'))) {
/* Must be an LV */
lv_name = strchr(vgname, '/');
lv_name = tmp_lv_name;
while (*lv_name == '/')
lv_name++;
if (!(vgname = extract_vgname(cmd, vgname))) {