Kaynağa Gözat

common: delete BinaryLength

The test is failing the 32bit build and the function
is not used anywhere.
Felix Lange 10 yıl önce
ebeveyn
işleme
9d152d6191
2 değiştirilmiş dosya ile 0 ekleme ve 25 silme
  1. 0 11
      common/bytes.go
  2. 0 14
      common/bytes_test.go

+ 0 - 11
common/bytes.go

@@ -106,17 +106,6 @@ func ReadVarInt(buff []byte) (ret uint64) {
 	return
 }
 
-// Binary length
-//
-// Returns the true binary length of the given number
-func BinaryLength(num int) int {
-	if num == 0 {
-		return 0
-	}
-
-	return 1 + BinaryLength(num>>8)
-}
-
 // Copy bytes
 //
 // Returns an exact copy of the provided bytes

+ 0 - 14
common/bytes_test.go

@@ -79,20 +79,6 @@ func (s *BytesSuite) TestReadVarInt(c *checker.C) {
 	c.Assert(res1, checker.Equals, exp1)
 }
 
-func (s *BytesSuite) TestBinaryLength(c *checker.C) {
-	data1 := 0
-	data2 := 920987656789
-
-	exp1 := 0
-	exp2 := 5
-
-	res1 := BinaryLength(data1)
-	res2 := BinaryLength(data2)
-
-	c.Assert(res1, checker.Equals, exp1)
-	c.Assert(res2, checker.Equals, exp2)
-}
-
 func (s *BytesSuite) TestCopyBytes(c *checker.C) {
 	data1 := []byte{1, 2, 3, 4}
 	exp1 := []byte{1, 2, 3, 4}