Skip to content

Commit e6af65d

Browse files
committed
common: Remove dead code
1 parent fbf3b2e commit e6af65d

2 files changed

Lines changed: 0 additions & 36 deletions

File tree

‎common/bytes.go‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,6 @@ func FromHex(s string) []byte {
4848
return nil
4949
}
5050

51-
type Bytes []byte
52-
53-
func (self Bytes) String() string {
54-
return string(self)
55-
}
56-
57-
func DeleteFromByteSlice(s [][]byte, hash []byte) [][]byte {
58-
for i, h := range s {
59-
if bytes.Compare(h, hash) == 0 {
60-
return append(s[:i:i], s[i+1:]...)
61-
}
62-
}
63-
64-
return s
65-
}
66-
6751
// Number to bytes
6852
//
6953
// Returns the number in bytes with the specified base

‎common/bytes_test.go‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,6 @@ type BytesSuite struct{}
2727

2828
var _ = checker.Suite(&BytesSuite{})
2929

30-
func (s *BytesSuite) TestByteString(c *checker.C) {
31-
var data Bytes
32-
data = []byte{102, 111, 111}
33-
exp := "foo"
34-
res := data.String()
35-
36-
c.Assert(res, checker.Equals, exp)
37-
}
38-
39-
/*
40-
func (s *BytesSuite) TestDeleteFromByteSlice(c *checker.C) {
41-
data := []byte{1, 2, 3, 4}
42-
slice := []byte{1, 2, 3, 4}
43-
exp := []byte{1, 4}
44-
res := DeleteFromByteSlice(data, slice)
45-
46-
c.Assert(res, checker.DeepEquals, exp)
47-
}
48-
49-
*/
5030
func (s *BytesSuite) TestNumberToBytes(c *checker.C) {
5131
// data1 := int(1)
5232
// res1 := NumberToBytes(data1, 16)

0 commit comments

Comments
 (0)