aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/string.goc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-10-23 04:31:11 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-10-23 04:31:11 +0000
commit4ccad563d2a3559f0557bfb177bcf45144219bdf (patch)
tree46bb86f514fbf6bad82da48e69a18fb09d878834 /libgo/runtime/string.goc
parent0b7463235f0e23c624d1911c9b15f531108cc5a6 (diff)
downloadgcc-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.goc14
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:
}