MRI: use RB_TYPE_P() instead of rb_type()

Just a very small optimization.
This commit is contained in:
cremno 2014-08-25 10:22:23 +02:00
parent 6d414c0777
commit 70c40fe530
5 changed files with 14 additions and 15 deletions

View file

@ -258,7 +258,7 @@ RB_METHOD(bitmapDrawText)
VALUE strObj;
rb_get_args(argc, argv, "oo|i", &rectObj, &strObj, &align RB_ARG_END);
if (rb_type(strObj) != RUBY_T_STRING)
if (!RB_TYPE_P(strObj, RUBY_T_STRING))
strObj = rb_funcallv(strObj, rb_intern("to_s"), 0, 0);
str = RSTRING_PTR(strObj);
@ -281,7 +281,7 @@ RB_METHOD(bitmapDrawText)
VALUE strObj;
rb_get_args(argc, argv, "iiiio|i", &x, &y, &width, &height, &strObj, &align RB_ARG_END);
if (rb_type(strObj) != RUBY_T_STRING)
if (!RB_TYPE_P(strObj, RUBY_T_STRING))
strObj = rb_funcallv(strObj, rb_intern("to_s"), 0, 0);
str = RSTRING_PTR(strObj);
@ -308,7 +308,7 @@ RB_METHOD(bitmapTextSize)
VALUE strObj;
rb_get_args(argc, argv, "o", &strObj RB_ARG_END);
if (rb_type(strObj) != RUBY_T_STRING)
if (!RB_TYPE_P(strObj, RUBY_T_STRING))
strObj = rb_funcallv(strObj, rb_intern("to_s"), 0, 0);
str = RSTRING_PTR(strObj);