diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-21 13:23:14 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-21 13:23:14 +0000 |
commit | e99be6e4a58561eb7521c57148ec65ba0d87dd7b (patch) | |
tree | 3ab3dd4df901851ff7f4345708592118766ba4aa /coreutils/expr.c | |
parent | ec7c757361d94d39f4c947ba1ec3cf6f928fca64 (diff) | |
download | busybox-w32-e99be6e4a58561eb7521c57148ec65ba0d87dd7b.tar.gz busybox-w32-e99be6e4a58561eb7521c57148ec65ba0d87dd7b.tar.bz2 busybox-w32-e99be6e4a58561eb7521c57148ec65ba0d87dd7b.zip |
introduce LONE_CHAR (optimized strcmp with one-char string)
git-svn-id: svn://busybox.net/trunk/busybox@17027 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/expr.c')
-rw-r--r-- | coreutils/expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
136 | if (v->type == integer) | 136 | if (v->type == integer) |
137 | return v->u.i == 0; | 137 | return v->u.i == 0; |
138 | else /* string: */ | 138 | else /* string: */ |
139 | return v->u.s[0] == '\0' || strcmp(v->u.s, "0") == 0; | 139 | return v->u.s[0] == '\0' || LONE_CHAR(v->u.s, '0'); |
140 | } | 140 | } |
141 | 141 | ||
142 | /* Coerce V to a string value (can't fail). */ | 142 | /* Coerce V to a string value (can't fail). */ |