Remove redundant if statement

This commit is contained in:
bloeys
2022-06-18 13:28:15 +04:00
parent a0af1959e0
commit b055178903

View File

@ -112,11 +112,7 @@ func (s *Sound) RemainingTime() time.Duration {
} }
var currBytePos int64 var currBytePos int64
if s.Info.Mode == SoundMode_Streaming { currBytePos, _ = s.Bytes.Seek(0, io.SeekCurrent)
currBytePos, _ = s.Bytes.Seek(0, io.SeekCurrent)
} else {
currBytePos, _ = s.Bytes.Seek(0, io.SeekCurrent)
}
lenInMS := float64(s.Info.Size-currBytePos) / float64(s.Info.SamplingRate) / 4 * 1000 lenInMS := float64(s.Info.Size-currBytePos) / float64(s.Info.SamplingRate) / 4 * 1000
return time.Duration(lenInMS) * time.Millisecond return time.Duration(lenInMS) * time.Millisecond