]> Cypherpunks repositories - gostls13.git/commitdiff
unicode/utf16: remove unnecessary type conversions
authorRui Ueyama <ruiu@google.com>
Sun, 23 Mar 2014 22:07:26 +0000 (15:07 -0700)
committerIan Lance Taylor <iant@golang.org>
Sun, 23 Mar 2014 22:07:26 +0000 (15:07 -0700)
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/79080044

src/pkg/unicode/utf16/utf16.go

index 903e4012aa4ab4cb592013f2d7cbc5b02c234f7a..c0e47c535ab6290f0e02abbea05e8ae2dad1a761 100644 (file)
@@ -36,7 +36,7 @@ func IsSurrogate(r rune) bool {
 // the Unicode replacement code point U+FFFD.
 func DecodeRune(r1, r2 rune) rune {
        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
 }