aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-24 10:36:16 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-24 10:36:16 +0000
commit96c7f6d30c0d12fc54e41065d1dbd0ef2debd4ed (patch)
tree533c9b947d0bd3fe1b8f6b268592e222715e0f72 /vm_insnhelper.c
parentb31f270d539c8a3a81a5490e7bd54b97ad28bf8b (diff)
downloadruby-96c7f6d30c0d12fc54e41065d1dbd0ef2debd4ed.tar.gz
vm_insnhelper.c (vm_check_if_namespace): tiny size reduction
Take advantage of "%+" modifier in the format string instead of explicitly calling rb_inspect to reduce object size. On x86 32-bit: text data bss dec hex filename before: 2949572 12448 30680 2992700 2daa3c miniruby after: 2949464 12448 30680 2992592 2da9d0 miniruby git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 86f6c4b2be..022a64df12 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -643,11 +643,8 @@ vm_get_const_base(const VALUE *ep)
static inline void
vm_check_if_namespace(VALUE klass)
{
- VALUE str;
if (!RB_TYPE_P(klass, T_CLASS) && !RB_TYPE_P(klass, T_MODULE)) {
- str = rb_inspect(klass);
- rb_raise(rb_eTypeError, "%s is not a class/module",
- StringValuePtr(str));
+ rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a class/module", klass);
}
}