remove unnecessary conditional

if animationState evaluates to -1 or 0, it would end up in a conditional that assign its value to itself. Since this is redundant, it is better to remove this conditional, to avoid an extra check
pull/4462/head
Gabriel Medeiros Coelho 2020-10-31 21:56:23 -03:00 committed by Richard Hansen
parent a95145d12c
commit ce77c48475
1 changed files with 1 additions and 5 deletions

View File

@ -308,11 +308,7 @@ var padutils = {
{ {
animationState = -1; animationState = -1;
} }
else if (animationState <= 0) else if (animationState > 0)
{
animationState = animationState;
}
else
{ {
animationState = Math.max(-1, Math.min(0, -animationState)); animationState = Math.max(-1, Math.min(0, -animationState));
} }