summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-14 09:30:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-14 09:30:32 (GMT)
commita7072a53147e689d2c265a66e87a2f6f74c86014 (patch)
treebec1f7fe2bc73a31209794bcb26c2a8972268b71 /generic/tclUtf.c
parentdd2ad07b7f17937585812360682cef3aed8ceb86 (diff)
downloadtcl-a7072a53147e689d2c265a66e87a2f6f74c86014.zip
tcl-a7072a53147e689d2c265a66e87a2f6f74c86014.tar.gz
tcl-a7072a53147e689d2c265a66e87a2f6f74c86014.tar.bz2
rfe-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;
}
/*