Skip to content

Commit 31805d9

Browse files
committed
random: Implement getFloat_gamma() optimization
see https://github.com/php/php-src/pull/9679/files#r994668327
1 parent 9a9be42 commit 31805d9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ext/random/randomizer.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ static double getFloat_gamma_high(double x)
141141

142142
static double getFloat_gamma(double x, double y)
143143
{
144-
double high = getFloat_gamma_high(x);
145-
double low = getFloat_gamma_low(y);
146-
147-
return high > low ? high : low;
144+
return (fabs(x) > fabs(y)) ? getFloat_gamma_high(x) : getFloat_gamma_low(y);
148145
}
149146

150147
static uint64_t getFloat_ceilint(double a, double b, double g)

0 commit comments

Comments
 (0)