Skip to content

Commit 3aac47e

Browse files
committed
remove some TODOs
1 parent e3b4379 commit 3aac47e

File tree

8 files changed

+6
-9
lines changed

8 files changed

+6
-9
lines changed

encoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func (enc *Encoder) createEncoderInternal(cache, internalCache encoderCache, typ
340340
cache[rType] = &directEncoder{x.encoder}
341341
}
342342
case *mapEncoderBuilder:
343-
// TODO: key/value encoder
343+
// TODO: key encoder
344344
x.encoder.elemEncoder = internalCache[x.elemRType]
345345
cache[rType] = &directEncoder{x.encoder}
346346
case *sliceEncoderBuilder:

iterator.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"fmt"
66
"io"
7+
"runtime"
78
)
89

910
// for fast reset
@@ -129,7 +130,6 @@ func (it *Iterator) readMore() error {
129130
n int
130131
err error
131132
)
132-
// TODO: risk of infinite loop?
133133
for {
134134
if it.capture {
135135
var buf [bufferSize]byte
@@ -156,6 +156,9 @@ func (it *Iterator) readMore() error {
156156
if n > 0 {
157157
return nil
158158
}
159+
// n == 0 && err == nil
160+
// the implementation of the reader is wrong
161+
runtime.Gosched()
159162
}
160163
}
161164

link_reflect.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ func mapiternext(it *hiter)
5656

5757
func unsafeMakeSlice(elemRType rtype, length, cap int) unsafe.Pointer {
5858
return unsafe.Pointer(&sliceHeader{
59-
// TODO: is this safe?
6059
Data: uintptr(unsafe_NewArray(elemRType, cap)),
6160
Len: length,
6261
Cap: cap,

streamer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ func (s *Streamer) Flush() error {
4747
// see comment of io.Writer
4848
n, err := s.writer.Write(s.buffer)
4949
if n < l {
50-
// TODO: shall we accept the writers which
51-
// TODO: do not implement Write method correctly?
5250
copy(s.buffer, s.buffer[n:])
5351
s.buffer = s.buffer[:l-n]
5452
} else {

struct.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ func describeStruct(st reflect.Type, tagKey string, onlyTaggedField bool) struct
169169
}
170170
}
171171

172-
// TODO: field name for encoder
173172
fields = append(fields, field)
174173
if count[f.typ] > 1 {
175174
/* when we arrived here, we are inside a level, where there are at least

val_decoder_native.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ func (*stringDecoder) Decode(ptr unsafe.Pointer, it *Iterator, opts *DecOpts) er
8787
}
8888
l := len(s)
8989
if l < 2 {
90-
// TODO: custom error
9190
return BadQuotedStringError(s)
9291
}
9392
switch s[0] {

val_encoder.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ type ValEncoder interface {
119119
type notSupportedEncoder string
120120

121121
func (enc notSupportedEncoder) IsEmpty(ptr unsafe.Pointer) bool {
122-
// TODO: error in interface?
123122
return false
124123
}
125124

val_encoder_json_number.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ func (*jsonNumberEncoder) Encode(ptr unsafe.Pointer, s *Streamer, opts *EncOpts)
2020
if str == "" {
2121
str = "0"
2222
}
23-
// TODO: the standard lib will check the validity
23+
// TODO: the standard library will check the validity in future
2424
s.RawString(str)
2525
}

0 commit comments

Comments
 (0)