if cond { return true }; return false => return cond
This commit is contained in:
parent
27db3ec262
commit
720e0ee0c7
1 changed files with 2 additions and 5 deletions
|
@ -515,11 +515,8 @@ func (idx *Index) merge(idx2 *Index) error {
|
||||||
// isErrOldIndex returns true if the error may be caused by an old index
|
// isErrOldIndex returns true if the error may be caused by an old index
|
||||||
// format.
|
// format.
|
||||||
func isErrOldIndex(err error) bool {
|
func isErrOldIndex(err error) bool {
|
||||||
if e, ok := err.(*json.UnmarshalTypeError); ok && e.Value == "array" {
|
e, ok := err.(*json.UnmarshalTypeError)
|
||||||
return true
|
return ok && e.Value == "array"
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DecodeIndex unserializes an index from buf.
|
// DecodeIndex unserializes an index from buf.
|
||||||
|
|
Loading…
Reference in a new issue