Permalink
Browse files

Change writeTString to writeString

  • Loading branch information...
1 parent 5636778 commit 9e46b0f089321597c4463b56000bf597a0dfbb3b @edsrzf committed Mar 11, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 encode.go
View
10 encode.go
@@ -116,7 +116,7 @@ func encodeUint(b *outbuf, v reflect.Value) {
}
func encodeString(b *outbuf, v reflect.Value) {
- b.writeTString(',', v.String())
+ b.writeString(v.String())
}
func encodeArray(b *outbuf, v reflect.Value) {
@@ -137,7 +137,7 @@ func encodeMap(b *outbuf, v reflect.Value) {
encodeFunc := lookupEncode(mapType.Elem().Kind())
for _, key := range v.MapKeys() {
encodeFunc(b, v.MapIndex(key))
- b.writeTString(',', key.String())
+ b.writeString(key.String())
}
b.writeLen(mark)
}
@@ -153,7 +153,7 @@ func encodeStruct(b *outbuf, v reflect.Value) {
str = field.Name
}
lookupEncode(field.Type.Kind())(b, v.Field(i))
- b.writeTString(',', str)
+ b.writeString(str)
}
b.writeLen(mark)
}
@@ -206,15 +206,15 @@ func (b *outbuf) mark(typ byte) int {
return len(b.buf) - b.n
}
-func (b *outbuf) writeTString(typ byte, s string) {
+func (b *outbuf) writeString(s string) {
l := len(s)
llen := digitCount(uint64(l))
n := llen + 1 + l + 1
if b.n < n {
b.grow(n)
}
b.n--
- b.buf[b.n] = typ
+ b.buf[b.n] = ','
b.n -= l
copy(b.buf[b.n:], s)
b.n--

0 comments on commit 9e46b0f

Please sign in to comment.