From ccfaabaed7a36ea3bbe3ade59270e4319a969c41 Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 7 Feb 2002 00:48:03 +0000 Subject: generic/regc_locale.c (casecmp): slight performance improvement --- generic/regc_locale.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/generic/regc_locale.c b/generic/regc_locale.c index 06f553f..bc5ef3d 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: regc_locale.c,v 1.7 2002/01/17 03:03:10 dgp Exp $ + * RCS: @(#) $Id: regc_locale.c,v 1.8 2002/02/07 00:48:03 hobbs Exp $ */ /* ASCII character-name table */ @@ -965,12 +965,8 @@ CONST chr *x; CONST chr *y; size_t len; /* exact length of comparison */ { - size_t i; - CONST chr *xp; - CONST chr *yp; - - for (xp = x, yp = y, i = len; i > 0; i--) - if (Tcl_UniCharToLower(*xp++) != Tcl_UniCharToLower(*yp++)) - return 1; - return 0; + for ( ; len > 0; len--, x++, y++) + if ((*x != *y) && (Tcl_UniCharToLower(*x) != Tcl_UniCharToLower(*y))) + return 1; + return 0; } -- cgit v0.12