Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Change writeTString to writeString

  • Loading branch information...
commit 9e46b0f089321597c4463b56000bf597a0dfbb3b 1 parent 5636778
Evan Shaw authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 encode.go
10 encode.go
@@ -116,7 +116,7 @@ func encodeUint(b *outbuf, v reflect.Value) {
116 116 }
117 117
118 118 func encodeString(b *outbuf, v reflect.Value) {
119   - b.writeTString(',', v.String())
  119 + b.writeString(v.String())
120 120 }
121 121
122 122 func encodeArray(b *outbuf, v reflect.Value) {
@@ -137,7 +137,7 @@ func encodeMap(b *outbuf, v reflect.Value) {
137 137 encodeFunc := lookupEncode(mapType.Elem().Kind())
138 138 for _, key := range v.MapKeys() {
139 139 encodeFunc(b, v.MapIndex(key))
140   - b.writeTString(',', key.String())
  140 + b.writeString(key.String())
141 141 }
142 142 b.writeLen(mark)
143 143 }
@@ -153,7 +153,7 @@ func encodeStruct(b *outbuf, v reflect.Value) {
153 153 str = field.Name
154 154 }
155 155 lookupEncode(field.Type.Kind())(b, v.Field(i))
156   - b.writeTString(',', str)
  156 + b.writeString(str)
157 157 }
158 158 b.writeLen(mark)
159 159 }
@@ -206,7 +206,7 @@ func (b *outbuf) mark(typ byte) int {
206 206 return len(b.buf) - b.n
207 207 }
208 208
209   -func (b *outbuf) writeTString(typ byte, s string) {
  209 +func (b *outbuf) writeString(s string) {
210 210 l := len(s)
211 211 llen := digitCount(uint64(l))
212 212 n := llen + 1 + l + 1
@@ -214,7 +214,7 @@ func (b *outbuf) writeTString(typ byte, s string) {
214 214 b.grow(n)
215 215 }
216 216 b.n--
217   - b.buf[b.n] = typ
  217 + b.buf[b.n] = ','
218 218 b.n -= l
219 219 copy(b.buf[b.n:], s)
220 220 b.n--

0 comments on commit 9e46b0f

Please sign in to comment.
Something went wrong with that request. Please try again.