common: Delete unused functions (#2452)

These functions were not used anywhere within tendermint, or the
cosmos-sdk. (The functionality is already duplicated in the cosmos-sdk
types package)

* common: Delete unused functions within byteslice
* remove more unused code from strings.go and int.go
* Remove more unused code from int.go
* Fix testcase
This commit is contained in:
Dev Ojha
2018-09-20 11:12:42 +02:00
committed by Alexander Simmerl
parent f76312ffe6
commit 0d6b75bd53
6 changed files with 6 additions and 182 deletions
-18
View File
@@ -1,28 +1,10 @@
package common
import (
"encoding/hex"
"fmt"
"strings"
)
// IsHex returns true for non-empty hex-string prefixed with "0x"
func IsHex(s string) bool {
if len(s) > 2 && strings.EqualFold(s[:2], "0x") {
_, err := hex.DecodeString(s[2:])
return err == nil
}
return false
}
// StripHex returns hex string without leading "0x"
func StripHex(s string) string {
if IsHex(s) {
return s[2:]
}
return s
}
// StringInSlice returns true if a is found the list.
func StringInSlice(a string, list []string) bool {
for _, b := range list {