From ae4c002f78e35028801342afb41945b9601df4b0 Mon Sep 17 00:00:00 2001 From: Davor Kapsa Date: Thu, 10 Jan 2019 17:51:25 +0100 Subject: [PATCH 1/3] rename ExampleMyKey --- example_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_test.go b/example_test.go index 7f521a3..1516b77 100644 --- a/example_test.go +++ b/example_test.go @@ -95,7 +95,7 @@ func ExampleGet() { // Crimson } -func ExampleMapKey() { +func ExampleMyKey() { hello := MyKey("hello") output, _ := Marshal(map[*MyKey]string{&hello: "world"}) fmt.Println(string(output)) From 16aef10b2b97aa6882f3a7d4cbfa773db52ff5f3 Mon Sep 17 00:00:00 2001 From: Davor Kapsa Date: Thu, 10 Jan 2019 17:55:28 +0100 Subject: [PATCH 2/3] clean readPositiveFloat32 --- iter_float.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iter_float.go b/iter_float.go index 3ccd757..799dc93 100644 --- a/iter_float.go +++ b/iter_float.go @@ -77,14 +77,12 @@ func (iter *Iterator) ReadFloat32() (ret float32) { } func (iter *Iterator) readPositiveFloat32() (ret float32) { - value := uint64(0) - c := byte(' ') i := iter.head // first char if i == iter.tail { return iter.readFloat32SlowPath() } - c = iter.buf[i] + c := iter.buf[i] i++ ind := floatDigits[c] switch ind { @@ -107,7 +105,7 @@ func (iter *Iterator) readPositiveFloat32() (ret float32) { return } } - value = uint64(ind) + value := uint64(ind) // chars before dot non_decimal_loop: for ; i < iter.tail; i++ { From 3a023a5fbc8df05d36eb00b9bce1e938792929b9 Mon Sep 17 00:00:00 2001 From: Davor Kapsa Date: Thu, 10 Jan 2019 18:00:15 +0100 Subject: [PATCH 3/3] clean readPositiveFloat64 --- iter_float.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iter_float.go b/iter_float.go index 799dc93..b975463 100644 --- a/iter_float.go +++ b/iter_float.go @@ -214,14 +214,12 @@ func (iter *Iterator) ReadFloat64() (ret float64) { } func (iter *Iterator) readPositiveFloat64() (ret float64) { - value := uint64(0) - c := byte(' ') i := iter.head // first char if i == iter.tail { return iter.readFloat64SlowPath() } - c = iter.buf[i] + c := iter.buf[i] i++ ind := floatDigits[c] switch ind { @@ -244,7 +242,7 @@ func (iter *Iterator) readPositiveFloat64() (ret float64) { return } } - value = uint64(ind) + value := uint64(ind) // chars before dot non_decimal_loop: for ; i < iter.tail; i++ {