Commit b55e017e authored by obscuren's avatar obscuren

Proper delete

parent 82be3054
...@@ -18,7 +18,7 @@ func (self Bytes) String() string { ...@@ -18,7 +18,7 @@ func (self Bytes) String() string {
func DeleteFromByteSlice(s [][]byte, hash []byte) [][]byte { func DeleteFromByteSlice(s [][]byte, hash []byte) [][]byte {
for i, h := range s { for i, h := range s {
if bytes.Compare(h, hash) == 0 { if bytes.Compare(h, hash) == 0 {
return append(s[:i], s[i+1:]...) return append(s[:i:i], s[i+1:]...)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment