Skip to content

Commit 14bfe18

Browse files
committed
Cleaned up code cruft from experimentation
1 parent 244adfe commit 14bfe18

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

parserescapes.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package jsonparser
22

33
import (
44
"bytes"
5-
"fmt"
65
"unicode/utf8"
76
)
87

@@ -34,8 +33,6 @@ func h2I(c byte) int {
3433
// is not checked.
3534
// In JSON, these escapes can either come alone or as part of "UTF16 surrogate pairs" that must be handled together.
3635
// This function only handles one; decodeUnicodeEscape handles this more complex case.
37-
var _ = fmt.Println
38-
3936
func decodeSingleUnicodeEscape(in []byte) (rune, bool) {
4037
// We need at least 6 characters total
4138
if len(in) < 6 {
@@ -131,8 +128,6 @@ func unescape(in, out []byte) ([]byte, error) {
131128
return nil, MalformedStringEscapeError
132129
}
133130

134-
//fmt.Printf("Decoded rune from UTF: inLen: %d, outLen: %d, rune UTF8: %x\n", inLen, bufLen, buf[:bufLen])
135-
136131
in = in[inLen:]
137132
buf = buf[bufLen:]
138133

parserescapes_test.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package jsonparser
22

33
import (
44
"bytes"
5-
"fmt"
65
"testing"
76
)
87

@@ -144,7 +143,6 @@ func isSameMemory(a, b []byte) bool {
144143
}
145144

146145
func TestUnescape(t *testing.T) {
147-
148146
for _, test := range unescapeTests {
149147
type bufferTestCase struct {
150148
buf []byte
@@ -188,28 +186,3 @@ func TestUnescape(t *testing.T) {
188186
}
189187
}
190188
}
191-
192-
//
193-
//escapeSequences := []string{
194-
//`\"`,
195-
//`\\`,
196-
//`\n`,
197-
//`\t`,
198-
//`\r`,
199-
//`\/`,
200-
//`\b`,
201-
//`\f`,
202-
//}
203-
//
204-
//runeValues := []struct {
205-
//r rune
206-
//ok bool
207-
//}{
208-
//{'"', true},
209-
//{'\\', true},
210-
//{'\n', true},
211-
//{'\t', true},
212-
//{'/', true},
213-
//{'\b', true},
214-
//{'\f', true},
215-
//}

0 commit comments

Comments
 (0)