From 6a575f6e244f93d5e3984ee2ca0466b4ee7dcc5b Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Fri, 4 Apr 1997 19:08:19 +0000 Subject: [PATCH] Eliminate some function calls when locale not used --- lib/libc/gen/fnmatch.c | 10 ++++------ sys/libkern/fnmatch.c | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index bd818cf7b4bb..1330ddbf4fef 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -187,12 +187,10 @@ rangematch(pattern, test, flags) if (flags & FNM_CASEFOLD) c2 = tolower((unsigned char)c2); - if ( ( __collate_load_error - && c <= test && test <= c2 - ) - || ( __collate_range_cmp(c, test) <= 0 - && __collate_range_cmp(test, c2) <= 0 - ) + if (__collate_load_error ? + c <= test && test <= c2 : + __collate_range_cmp(c, test) <= 0 + && __collate_range_cmp(test, c2) <= 0 ) ok = 1; } else if (c == test) diff --git a/sys/libkern/fnmatch.c b/sys/libkern/fnmatch.c index bd818cf7b4bb..1330ddbf4fef 100644 --- a/sys/libkern/fnmatch.c +++ b/sys/libkern/fnmatch.c @@ -187,12 +187,10 @@ rangematch(pattern, test, flags) if (flags & FNM_CASEFOLD) c2 = tolower((unsigned char)c2); - if ( ( __collate_load_error - && c <= test && test <= c2 - ) - || ( __collate_range_cmp(c, test) <= 0 - && __collate_range_cmp(test, c2) <= 0 - ) + if (__collate_load_error ? + c <= test && test <= c2 : + __collate_range_cmp(c, test) <= 0 + && __collate_range_cmp(test, c2) <= 0 ) ok = 1; } else if (c == test)