소스 검색

clean readPositiveFloat64

Davor Kapsa 7 년 전
부모
커밋
3a023a5fbc
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      iter_float.go

+ 2 - 4
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++ {