From b055178903d75decfa0da3c571f2300bd6959a9a Mon Sep 17 00:00:00 2001 From: bloeys Date: Sat, 18 Jun 2022 13:28:15 +0400 Subject: [PATCH] Remove redundant if statement --- wavy.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wavy.go b/wavy.go index 9f6e4d4..77ff47f 100644 --- a/wavy.go +++ b/wavy.go @@ -112,11 +112,7 @@ func (s *Sound) RemainingTime() time.Duration { } var currBytePos int64 - if s.Info.Mode == SoundMode_Streaming { - currBytePos, _ = s.Bytes.Seek(0, io.SeekCurrent) - } else { - currBytePos, _ = s.Bytes.Seek(0, io.SeekCurrent) - } + currBytePos, _ = s.Bytes.Seek(0, io.SeekCurrent) lenInMS := float64(s.Info.Size-currBytePos) / float64(s.Info.SamplingRate) / 4 * 1000 return time.Duration(lenInMS) * time.Millisecond