mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
615d99b7e7
commit
0feaa041e7
2 changed files with 5 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
Sun Jan 24 19:34:23 2016 Eric Wong <e@80x24.org>
|
||||
|
||||
* vm_insnhelper.c (vm_check_if_namespace): tiny size reduction
|
||||
|
||||
Sun Jan 24 18:12:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||
|
||||
* common.mk: Simplifying Unicode data file download logic to make
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue