From af005668daa679665b6eb0957a87ed3a0cbed3f0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 21 May 2011 23:14:55 -0700 Subject: Avoid using an unnecessary temp variable --- Alc/ALu.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Alc') diff --git a/Alc/ALu.c b/Alc/ALu.c index b387d7e1..b37d04e8 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -660,10 +660,9 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) { const ALshort *hrtf_left, *hrtf_right; - length = OrigDist; - if(length > 0.0f) + if(OrigDist > 0.0f) { - ALfloat invlen = 1.0f/length; + ALfloat invlen = 1.0f/OrigDist; Position[0] *= invlen; Position[1] *= invlen; Position[2] *= invlen; @@ -674,10 +673,8 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) &hrtf_left, &hrtf_right); for(i = 0;i < HRTF_LENGTH;i++) { - ALSource->Params.HrtfCoeffs[0][i][0] = hrtf_left[i]*(1.0/32767.0)* - DryGain; - ALSource->Params.HrtfCoeffs[0][i][1] = hrtf_right[i]*(1.0/32767.0)* - DryGain; + ALSource->Params.HrtfCoeffs[0][i][0] = hrtf_left[i]*(1.0/32767.0) * DryGain; + ALSource->Params.HrtfCoeffs[0][i][1] = hrtf_right[i]*(1.0/32767.0) * DryGain; } } else -- cgit v1.2.3