avoid redundant zero checking

count will never become 0
This commit is contained in:
derselbst 2017-10-25 10:42:59 +02:00
parent e485129705
commit 27f2ed3750

View file

@ -1013,7 +1013,7 @@ fluid_voice_update_param(fluid_voice_t* voice, int gen)
fluid_clip(x, -12000.0f, 8000.0f);
count = 1 + NUM_BUFFERS_ATTACK(x);
fluid_voice_update_volenv(voice, FLUID_VOICE_ENVATTACK,
count, 1.0f, count ? 1.0f / count : 0.0f, -1.0f, 1.0f);
count, 1.0f, 1.0f / count, -1.0f, 1.0f);
break;
case GEN_VOLENVHOLD: /* SF2.01 section 8.1.3 # 35 */
@ -1038,7 +1038,7 @@ fluid_voice_update_param(fluid_voice_t* voice, int gen)
fluid_clip(x, FLUID_MIN_VOLENVRELEASE, 8000.0f);
count = 1 + NUM_BUFFERS_RELEASE(x);
fluid_voice_update_volenv(voice, FLUID_VOICE_ENVRELEASE,
count, 1.0f, count ? -1.0f / count : 0.0f, 0.0f, 1.0f);
count, 1.0f, -1.0f / count, 0.0f, 1.0f);
break;
/* Modulation envelope */
@ -1054,7 +1054,7 @@ fluid_voice_update_param(fluid_voice_t* voice, int gen)
fluid_clip(x, -12000.0f, 8000.0f);
count = 1 + NUM_BUFFERS_ATTACK(x);
fluid_voice_update_modenv(voice, FLUID_VOICE_ENVATTACK,
count, 1.0f, count ? 1.0f / count : 0.0f, -1.0f, 1.0f);
count, 1.0f, 1.0f / count, -1.0f, 1.0f);
break;
case GEN_MODENVHOLD: /* SF2.01 section 8.1.3 # 27 */
@ -1079,7 +1079,7 @@ fluid_voice_update_param(fluid_voice_t* voice, int gen)
fluid_clip(x, -12000.0f, 8000.0f);
count = 1 + NUM_BUFFERS_RELEASE(x);
fluid_voice_update_modenv(voice, FLUID_VOICE_ENVRELEASE,
count, 1.0f, count ? -1.0f / count : 0.0f, 0.0f, 2.0f);
count, 1.0f, -1.0f / count, 0.0f, 2.0f);
break;