Tween: Fix undefined behavior found by static code analyzer.

Adresses the issue mentioned in https://software.intel.com/en-us/articles/the-ultimate-question-of-programming-refactoring-and-everything
This commit is contained in:
Andreas Haas 2017-02-21 23:28:52 +01:00
parent de0045cf1b
commit 0157969ccc
No known key found for this signature in database
GPG Key ID: B5FFAE1B65FBD2E1

View File

@ -262,7 +262,8 @@ namespace cubic {
static real_t out(real_t t, real_t b, real_t c, real_t d)
{
return c * ((t = t / d - 1) * t * t + 1) + b;
t = t / d - 1;
return c * (t * t * t + 1) + b;
}
static real_t in_out(real_t t, real_t b, real_t c, real_t d)