From 60c89cd75b5e3a3523b7edbc9fc2187e945195b8 Mon Sep 17 00:00:00 2001 From: Mark Kremer Date: Sat, 3 Aug 2024 19:47:58 +0200 Subject: [PATCH] Remove unnecessary casts --- flac/decode.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/flac/decode.go b/flac/decode.go index 2c82619..339f2e0 100644 --- a/flac/decode.go +++ b/flac/decode.go @@ -103,28 +103,28 @@ func (d *decoder) decodeFrameRangeInto(frame *frame.Frame, start, num int, into switch { case bps == 8 && numChannels == 1: for i := 0; i < num; i++ { - into[i][0] = float64(int8(frame.Subframes[0].Samples[start+i])) * q + into[i][0] = float64(frame.Subframes[0].Samples[start+i]) * q into[i][1] = into[i][0] } case bps == 16 && numChannels == 1: for i := 0; i < num; i++ { - into[i][0] = float64(int16(frame.Subframes[0].Samples[start+i])) * q + into[i][0] = float64(frame.Subframes[0].Samples[start+i]) * q into[i][1] = into[i][0] } case bps == 24 && numChannels == 1: for i := 0; i < num; i++ { - into[i][0] = float64(int32(frame.Subframes[0].Samples[start+i])) * q + into[i][0] = float64(frame.Subframes[0].Samples[start+i]) * q into[i][1] = into[i][0] } case bps == 8 && numChannels >= 2: for i := 0; i < num; i++ { - into[i][0] = float64(int8(frame.Subframes[0].Samples[start+i])) * q - into[i][1] = float64(int8(frame.Subframes[1].Samples[start+i])) * q + into[i][0] = float64(frame.Subframes[0].Samples[start+i]) * q + into[i][1] = float64(frame.Subframes[1].Samples[start+i]) * q } case bps == 16 && numChannels >= 2: for i := 0; i < num; i++ { - into[i][0] = float64(int16(frame.Subframes[0].Samples[start+i])) * q - into[i][1] = float64(int16(frame.Subframes[1].Samples[start+i])) * q + into[i][0] = float64(frame.Subframes[0].Samples[start+i]) * q + into[i][1] = float64(frame.Subframes[1].Samples[start+i]) * q } case bps == 24 && numChannels >= 2: for i := 0; i < num; i++ {