summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-22 21:41:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-22 21:41:11 (GMT)
commit40a794e7c84fac5d968985b3ac2f1507fe2e800c (patch)
tree0d0942519126dd5cb530385a7118dfabf5363134 /generic/tclUtf.c
parent11fcad9b1df2c2cf7d5ada8feb565c97b9777fef (diff)
parentb8651ae498dba4d0a1edcff000582bc06a7a8efe (diff)
downloadtcl-40a794e7c84fac5d968985b3ac2f1507fe2e800c.zip
tcl-40a794e7c84fac5d968985b3ac2f1507fe2e800c.tar.gz
tcl-40a794e7c84fac5d968985b3ac2f1507fe2e800c.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 6b5e2e8..b6da7c3 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -1122,10 +1122,9 @@ Tcl_UniCharToUpper(ch)
int info = GetUniCharInfo(ch);
if (GetCaseType(info) & 0x04) {
- return (Tcl_UniChar) (ch - GetDelta(info));
- } else {
- return ch;
+ ch -= GetDelta(info);
}
+ return (Tcl_UniChar) ch;
}
/*
@@ -1151,10 +1150,9 @@ Tcl_UniCharToLower(ch)
int info = GetUniCharInfo(ch);
if (GetCaseType(info) & 0x02) {
- return (Tcl_UniChar) (ch + GetDelta(info));
- } else {
- return ch;
+ ch += GetDelta(info);
}
+ return (Tcl_UniChar) ch;
}
/*
@@ -1185,12 +1183,11 @@ Tcl_UniCharToTitle(ch)
* 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;
}
/*