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) --- coreutils/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coreutils/expr.c') diff --git a/coreutils/expr.c b/coreutils/expr.c index 191473446..51e553dc6 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -136,7 +136,7 @@ static int null(VALUE * v) if (v->type == integer) return v->u.i == 0; else /* string: */ - return v->u.s[0] == '\0' || strcmp(v->u.s, "0") == 0; + return v->u.s[0] == '\0' || LONE_CHAR(v->u.s, '0'); } /* Coerce V to a string value (can't fail). */ -- cgit v1.2.3