summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-20 20:09:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-20 20:09:29 (GMT)
commitab2ee17c917d4c1ac391bc15fe68a87e672f2f73 (patch)
tree7c4f63c41795347c14b781d88cec86b1ff8d310b /generic/tclUtil.c
parentdb2c4a21b2cc03076d2c22b74dea2662f5f35143 (diff)
parent30f26cff8be85483cb7c90b15ce9acc2f4607583 (diff)
downloadtcl-ab2ee17c917d4c1ac391bc15fe68a87e672f2f73.zip
tcl-ab2ee17c917d4c1ac391bc15fe68a87e672f2f73.tar.gz
tcl-ab2ee17c917d4c1ac391bc15fe68a87e672f2f73.tar.bz2
Fix [6811a00819]: lsearch performance degradation on Tcl 8.6.11 release (thanks, Sergey!)
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 25f84e4..2219c84 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -1717,7 +1717,7 @@ TclTrimRight(
pp = Tcl_UtfPrev(p, bytes);
do {
pp += pInc;
- pInc = Tcl_UtfToUniChar(pp, &ch1);
+ pInc = TclUtfToUniChar(pp, &ch1);
} while (pp + pInc < p);
/*
@@ -1725,7 +1725,7 @@ TclTrimRight(
*/
do {
- pInc = Tcl_UtfToUniChar(q, &ch2);
+ pInc = TclUtfToUniChar(q, &ch2);
if (ch1 == ch2) {
break;
@@ -1790,7 +1790,7 @@ TclTrimLeft(
*/
do {
- Tcl_Size pInc = Tcl_UtfToUniChar(p, &ch1);
+ Tcl_Size pInc = TclUtfToUniChar(p, &ch1);
const char *q = trim;
Tcl_Size bytesLeft = numTrim;
@@ -1799,7 +1799,7 @@ TclTrimLeft(
*/
do {
- Tcl_Size qInc = Tcl_UtfToUniChar(q, &ch2);
+ Tcl_Size qInc = TclUtfToUniChar(q, &ch2);
if (ch1 == ch2) {
break;
@@ -1866,7 +1866,7 @@ TclTrim(
if (numBytes > 0) {
int ch;
const char *first = bytes + trimLeft;
- bytes += Tcl_UtfToUniChar(first, &ch);
+ bytes += TclUtfToUniChar(first, &ch);
numBytes -= (bytes - first);
if (numBytes > 0) {
@@ -2221,7 +2221,7 @@ Tcl_StringCaseMatch(
ch2 = (int)
(nocase ? tolower(UCHAR(*pattern)) : UCHAR(*pattern));
} else {
- Tcl_UtfToUniChar(pattern, &ch2);
+ TclUtfToUniChar(pattern, &ch2);
if (nocase) {
ch2 = Tcl_UniCharToLower(ch2);
}
@@ -2237,7 +2237,7 @@ Tcl_StringCaseMatch(
if ((p != '[') && (p != '?') && (p != '\\')) {
if (nocase) {
while (*str) {
- charLen = Tcl_UtfToUniChar(str, &ch1);
+ charLen = TclUtfToUniChar(str, &ch1);
if (ch2==ch1 || ch2==Tcl_UniCharToLower(ch1)) {
break;
}
@@ -2251,7 +2251,7 @@ Tcl_StringCaseMatch(
*/
while (*str) {
- charLen = Tcl_UtfToUniChar(str, &ch1);
+ charLen = TclUtfToUniChar(str, &ch1);
if (ch2 == ch1) {
break;
}
@@ -2265,7 +2265,7 @@ Tcl_StringCaseMatch(
if (*str == '\0') {
return 0;
}
- str += Tcl_UtfToUniChar(str, &ch1);
+ str += TclUtfToUniChar(str, &ch1);
}
}
@@ -2276,7 +2276,7 @@ Tcl_StringCaseMatch(
if (p == '?') {
pattern++;
- str += Tcl_UtfToUniChar(str, &ch1);
+ str += TclUtfToUniChar(str, &ch1);
continue;
}
@@ -2295,7 +2295,7 @@ Tcl_StringCaseMatch(
(nocase ? tolower(UCHAR(*str)) : UCHAR(*str));
str++;
} else {
- str += Tcl_UtfToUniChar(str, &ch1);
+ str += TclUtfToUniChar(str, &ch1);
if (nocase) {
ch1 = Tcl_UniCharToLower(ch1);
}
@@ -2309,7 +2309,7 @@ Tcl_StringCaseMatch(
? tolower(UCHAR(*pattern)) : UCHAR(*pattern));
pattern++;
} else {
- pattern += Tcl_UtfToUniChar(pattern, &startChar);
+ pattern += TclUtfToUniChar(pattern, &startChar);
if (nocase) {
startChar = Tcl_UniCharToLower(startChar);
}
@@ -2324,7 +2324,7 @@ Tcl_StringCaseMatch(
? tolower(UCHAR(*pattern)) : UCHAR(*pattern));
pattern++;
} else {
- pattern += Tcl_UtfToUniChar(pattern, &endChar);
+ pattern += TclUtfToUniChar(pattern, &endChar);
if (nocase) {
endChar = Tcl_UniCharToLower(endChar);
}
@@ -2372,8 +2372,8 @@ Tcl_StringCaseMatch(
* each string match.
*/
- str += Tcl_UtfToUniChar(str, &ch1);
- pattern += Tcl_UtfToUniChar(pattern, &ch2);
+ str += TclUtfToUniChar(str, &ch1);
+ pattern += TclUtfToUniChar(pattern, &ch2);
if (nocase) {
if (Tcl_UniCharToLower(ch1) != Tcl_UniCharToLower(ch2)) {
return 0;