diff options
author | jan.nijtmans <jan.nijtmans@noemail.net> | 2012-01-14 09:30:32 (GMT) |
---|---|---|
committer | jan.nijtmans <jan.nijtmans@noemail.net> | 2012-01-14 09:30:32 (GMT) |
commit | 8913f1711178591b5f7b7363c78e2a2416d9a305 (patch) | |
tree | bec1f7fe2bc73a31209794bcb26c2a8972268b71 /generic/tclUtf.c | |
parent | 44973b78aa4baee13ed884c07e7338c9ce428588 (diff) | |
download | tcl-8913f1711178591b5f7b7363c78e2a2416d9a305.zip tcl-8913f1711178591b5f7b7363c78e2a2416d9a305.tar.gz tcl-8913f1711178591b5f7b7363c78e2a2416d9a305.tar.bz2 |
rfe-3473670: Various Unicode-related speedups/robustness
FossilOrigin-Name: 92168a99c12bd4eca8cb5d3142f6fa1e9898d5cc
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r-- | generic/tclUtf.c | 17 |
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; } /* |