Commit 160649ff authored by Rui Ueyama's avatar Rui Ueyama Committed by Ian Lance Taylor

unicode/utf16: remove unnecessary type conversions

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/79080044
parent fa445849
...@@ -36,7 +36,7 @@ func IsSurrogate(r rune) bool { ...@@ -36,7 +36,7 @@ func IsSurrogate(r rune) bool {
// the Unicode replacement code point U+FFFD. // the Unicode replacement code point U+FFFD.
func DecodeRune(r1, r2 rune) rune { func DecodeRune(r1, r2 rune) rune {
if surr1 <= r1 && r1 < surr2 && surr2 <= r2 && r2 < surr3 { if surr1 <= r1 && r1 < surr2 && surr2 <= r2 && r2 < surr3 {
return (rune(r1)-surr1)<<10 | (rune(r2) - surr2) + 0x10000 return (r1-surr1)<<10 | (r2 - surr2) + 0x10000
} }
return replacementChar return replacementChar
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment