Skip to content

Commit 9d152d6

Browse files
committed
common: delete BinaryLength
The test is failing the 32bit build and the function is not used anywhere.
1 parent 2f4cc72 commit 9d152d6

2 files changed

Lines changed: 0 additions & 25 deletions

File tree

‎common/bytes.go‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,6 @@ func ReadVarInt(buff []byte) (ret uint64) {
106106
return
107107
}
108108

109-
// Binary length
110-
//
111-
// Returns the true binary length of the given number
112-
func BinaryLength(num int) int {
113-
if num == 0 {
114-
return 0
115-
}
116-
117-
return 1 + BinaryLength(num>>8)
118-
}
119-
120109
// Copy bytes
121110
//
122111
// Returns an exact copy of the provided bytes

‎common/bytes_test.go‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,6 @@ func (s *BytesSuite) TestReadVarInt(c *checker.C) {
7979
c.Assert(res1, checker.Equals, exp1)
8080
}
8181

82-
func (s *BytesSuite) TestBinaryLength(c *checker.C) {
83-
data1 := 0
84-
data2 := 920987656789
85-
86-
exp1 := 0
87-
exp2 := 5
88-
89-
res1 := BinaryLength(data1)
90-
res2 := BinaryLength(data2)
91-
92-
c.Assert(res1, checker.Equals, exp1)
93-
c.Assert(res2, checker.Equals, exp2)
94-
}
95-
9682
func (s *BytesSuite) TestCopyBytes(c *checker.C) {
9783
data1 := []byte{1, 2, 3, 4}
9884
exp1 := []byte{1, 2, 3, 4}

0 commit comments

Comments
 (0)