We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81fb72b commit 5a3ec97Copy full SHA for 5a3ec97
ext/mysql2/statement.c
@@ -231,11 +231,14 @@ static int my_big2ll(VALUE bignum, LONG_LONG *ptr)
231
nlz_bits == 0 &&
232
#endif
233
#if defined(HAVE_RB_ABSINT_SIZE) && defined(HAVE_RB_ABSINT_SINGLEBIT_P)
234
- /* only -0x8000000000000000 is safe if `len == 8 && nlz_bits == 0` */
+ /* Optimized to avoid object allocation for Ruby 2.1+
235
+ * only -0x8000000000000000 is safe if `len == 8 && nlz_bits == 0`
236
+ */
237
!rb_absint_singlebit_p(bignum)
238
#elif defined(HAVE_RB_BIG_CMP)
239
rb_big_cmp(bignum, LL2NUM(LLONG_MIN)) == INT2FIX(-1)
240
#else
241
+ /* Ruby 1.8.7 doesn't have rb_big_cmp */
242
rb_funcall(bignum, intern_cmp, 1, LL2NUM(LLONG_MIN)) == INT2FIX(-1)
243
244
) {
0 commit comments