Commit b80fdd1e authored by Russ Cox's avatar Russ Cox

an early 6g limitation forced the use of

	string(b)[0:n]
instead of the more direct string(b[0:n]).
convert to the more direct form.

R=r
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=27082
CL=27140
parent 0ea09195
...@@ -135,7 +135,7 @@ func readBytes(buf *BufRead) string { ...@@ -135,7 +135,7 @@ func readBytes(buf *BufRead) string {
nb++; nb++;
} }
// BUG return string(b[0:nb]) ? // BUG return string(b[0:nb]) ?
return string(b)[0:nb] return string(b[0:nb])
} }
// Call Read to accumulate the text of a file // Call Read to accumulate the text of a file
......
...@@ -222,7 +222,7 @@ func (f *Fmt) integer(a int64, base uint, is_signed bool, digits *string) string ...@@ -222,7 +222,7 @@ func (f *Fmt) integer(a int64, base uint, is_signed bool, digits *string) string
buf[i] = ' '; buf[i] = ' ';
i--; i--;
} }
return string(buf)[i+1:nByte]; return string(buf[i+1:nByte]);
} }
// Fmt_d64 formats an int64 in decimal. // Fmt_d64 formats an int64 in decimal.
......
...@@ -231,7 +231,7 @@ func str(val int64) string { // do it here rather than with fmt to avoid depend ...@@ -231,7 +231,7 @@ func str(val int64) string { // do it here rather than with fmt to avoid depend
val /= 10; val /= 10;
} }
buf[i] = byte(val + '0'); buf[i] = byte(val + '0');
return string(buf)[i:len(buf)]; return string(buf[i:len(buf)]);
} }
func Errstr(errno int64) string { func Errstr(errno int64) string {
......
...@@ -281,7 +281,7 @@ func str(val int64) string { // do it here rather than with fmt to avoid depend ...@@ -281,7 +281,7 @@ func str(val int64) string { // do it here rather than with fmt to avoid depend
val /= 10; val /= 10;
} }
buf[i] = byte(val + '0'); buf[i] = byte(val + '0');
return string(buf)[i:len(buf)]; return string(buf[i:len(buf)]);
} }
func Errstr(errno int64) string { func Errstr(errno int64) string {
......
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