aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-23 07:15:26 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-23 07:15:26 +0000
commitf9cefe2f9b7fcde71a145acd7158fd4128d5e4bc (patch)
treec9ac48715577961bbfdfb3b589d6eb181994da33 /include
parentc23167e3144603c3b6438c1f007836bde18620e4 (diff)
downloadruby-f9cefe2f9b7fcde71a145acd7158fd4128d5e4bc.tar.gz
* include/ruby/ruby.h (rb_mul_size_overflow): use UNLIKELY
by user side to improve generallity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index b12beff9b1..ef6caa1163 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1628,10 +1628,10 @@ rb_mul_size_overflow(size_t a, size_t b, size_t max, size_t *c)
{
#ifdef DSIZE_T
DSIZE_T c2 = (DSIZE_T)a * (DSIZE_T)b;
- if (RB_UNLIKELY(c2 > max)) return 1;
+ if (c2 > max) return 1;
*c = (size_t)c2;
#else
- if (b != 0 && RB_UNLIKELY(a > max / b)) return 1;
+ if (b != 0 && a > max / b) return 1;
*c = a * b;
#endif
return 0;