diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-10-23 04:31:11 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-10-23 04:31:11 +0000 |
commit | 4ccad563d2a3559f0557bfb177bcf45144219bdf (patch) | |
tree | 46bb86f514fbf6bad82da48e69a18fb09d878834 /libgo/runtime/string.goc | |
parent | 0b7463235f0e23c624d1911c9b15f531108cc5a6 (diff) | |
download | gcc-4ccad563d2a3559f0557bfb177bcf45144219bdf.zip gcc-4ccad563d2a3559f0557bfb177bcf45144219bdf.tar.gz gcc-4ccad563d2a3559f0557bfb177bcf45144219bdf.tar.bz2 |
libgo: Update to current sources.
From-SVN: r192704
Diffstat (limited to 'libgo/runtime/string.goc')
-rw-r--r-- | libgo/runtime/string.goc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libgo/runtime/string.goc b/libgo/runtime/string.goc index 486caf0..4e616c7 100644 --- a/libgo/runtime/string.goc +++ b/libgo/runtime/string.goc @@ -32,8 +32,8 @@ enum Runeself = 0x80, }; -func stringiter(s String, k int32) (retk int32) { - int32 l, n; +func stringiter(s String, k int) (retk int) { + int32 l; if(k >= s.__length) { // retk=0 is end of iteration @@ -48,15 +48,12 @@ func stringiter(s String, k int32) (retk int32) { } // multi-char rune - n = charntorune(&l, s.__data+k, s.__length-k); - retk = k + (n ? n : 1); + retk = k + charntorune(&l, s.__data+k, s.__length-k); out: } -func stringiter2(s String, k int32) (retk int32, retv int32) { - int32 n; - +func stringiter2(s String, k int) (retk int, retv int) { if(k >= s.__length) { // retk=0 is end of iteration retk = 0; @@ -71,8 +68,7 @@ func stringiter2(s String, k int32) (retk int32, retv int32) { } // multi-char rune - n = charntorune(&retv, s.__data+k, s.__length-k); - retk = k + (n ? n : 1); + retk = k + charntorune(&retv, s.__data+k, s.__length-k); out: } |