From 47d9285956bae12307c96d558a889c404acaaba5 Mon Sep 17 00:00:00 2001 From: David Howden Date: Sun, 24 May 2015 13:13:06 +1000 Subject: [PATCH] Small refactor to dataSplit --- id3v2frames.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/id3v2frames.go b/id3v2frames.go index f3d915b..d90dc11 100644 --- a/id3v2frames.go +++ b/id3v2frames.go @@ -76,9 +76,10 @@ func dataSplit(b []byte, enc byte) ([][]byte, error) { if err != nil { return nil, err } - result := bytes.SplitN(b, delim, 2) - if len(result) <= 1 { + result := bytes.SplitN(b, delim, 2) + if len(result) != 2 { + return result, nil } @@ -87,7 +88,6 @@ func dataSplit(b []byte, enc byte) ([][]byte, error) { result[0] = append(result[0], make([]byte, 0)...) result[1] = result[1][1:] } - return result, nil }