summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-22 21:49:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-22 21:49:22 (GMT)
commita2f9926dbfa80edc8f823d9182d3ccaa8f976240 (patch)
tree77d90f4270121b7912bce03cf0ecc909784cbdfa /generic/tclUtf.c
parentd40680de05ee6071b6e4579157be4d7947a53ddd (diff)
parent40a794e7c84fac5d968985b3ac2f1507fe2e800c (diff)
downloadtcl-a2f9926dbfa80edc8f823d9182d3ccaa8f976240.zip
tcl-a2f9926dbfa80edc8f823d9182d3ccaa8f976240.tar.gz
tcl-a2f9926dbfa80edc8f823d9182d3ccaa8f976240.tar.bz2
[Frq 3473670]: Various Unicode-related speedups/robustness
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index ff1f120..83900e9 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -1125,10 +1125,9 @@ Tcl_UniCharToUpper(
int info = GetUniCharInfo(ch);
if (GetCaseType(info) & 0x04) {
- return (Tcl_UniChar) (ch - GetDelta(info));
- } else {
- return ch;
+ ch -= GetDelta(info);
}
+ return (Tcl_UniChar) ch;
}
/*
@@ -1154,10 +1153,9 @@ Tcl_UniCharToLower(
int info = GetUniCharInfo(ch);
if (GetCaseType(info) & 0x02) {
- return (Tcl_UniChar) (ch + GetDelta(info));
- } else {
- return ch;
+ ch += GetDelta(info);
}
+ return (Tcl_UniChar) ch;
}
/*
@@ -1188,12 +1186,11 @@ Tcl_UniCharToTitle(
* Subtract or add one depending on the original case.
*/
- return (Tcl_UniChar) (ch + ((mode & 0x4) ? -1 : 1));
+ ch += ((mode & 0x4) ? -1 : 1);
} else if (mode == 0x4) {
- return (Tcl_UniChar) (ch - GetDelta(info));
- } else {
- return ch;
+ ch -= GetDelta(info);
}
+ return (Tcl_UniChar) ch;
}
/*