MRI: some minor optimizations

This commit is contained in:
cremno 2014-01-24 22:23:30 +01:00
parent cb39c2f345
commit f06769b434
6 changed files with 24 additions and 22 deletions

View file

@ -54,7 +54,7 @@ RB_METHOD(viewportElementSetViewport)
rb_get_args(argc, argv, "o", &viewportObj RB_ARG_END);
if (rb_type(viewportObj) != RUBY_T_NIL)
if (!NIL_P(viewportObj))
viewport = getPrivateDataCheck<Viewport>(viewportObj, ViewportType);
GUARD_EXC( ve->setViewport(viewport); );
@ -76,7 +76,7 @@ viewportElementInitialize(int argc, VALUE *argv, VALUE self)
rb_get_args(argc, argv, "|o", &viewportObj RB_ARG_END);
if (rb_type(viewportObj) != RUBY_T_NIL)
if (!NIL_P(viewportObj))
viewport = getPrivateDataCheck<Viewport>(viewportObj, ViewportType);
/* Construct object */