From bf66fbc8e2380717c1fab860cfc60c78582839dd Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 21 Dec 2006 13:23:14 +0000 Subject: introduce LONE_CHAR (optimized strcmp with one-char string) --- e2fsprogs/blkid/devname.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'e2fsprogs/blkid/devname.c') diff --git a/e2fsprogs/blkid/devname.c b/e2fsprogs/blkid/devname.c index d69000b..3d11734 100644 --- a/e2fsprogs/blkid/devname.c +++ b/e2fsprogs/blkid/devname.c @@ -189,7 +189,7 @@ static void lvm_probe_all(blkid_cache cache) struct dirent *lv_iter; vg_name = vg_iter->d_name; - if (!strcmp(vg_name, ".") || !strcmp(vg_name, "..")) + if (LONE_CHAR(vg_name, '.') || !strcmp(vg_name, "..")) continue; vdirname = xmalloc(vg_len + strlen(vg_name) + 8); sprintf(vdirname, "%s/%s/LVs", VG_DIR, vg_name); @@ -203,7 +203,7 @@ static void lvm_probe_all(blkid_cache cache) char *lv_name, *lvm_device; lv_name = lv_iter->d_name; - if (!strcmp(lv_name, ".") || !strcmp(lv_name, "..")) + if (LONE_CHAR(lv_name, '.') || !strcmp(lv_name, "..")) continue; lvm_device = xmalloc(vg_len + strlen(vg_name) + -- cgit v1.1