1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

symbol/init.c: ID value

* ext/-test-/symbol/init.c (sym_pinneddown_p): return ID value or
  nil for debugging.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-02-12 02:48:28 +00:00
parent 6d0f7c3c7d
commit 01134984ef

View file

@ -11,7 +11,13 @@ sym_find(VALUE dummy, VALUE sym)
static VALUE static VALUE
sym_pinneddown_p(VALUE dummy, VALUE sym) sym_pinneddown_p(VALUE dummy, VALUE sym)
{ {
return rb_check_id(&sym) ? Qtrue : Qfalse; ID id = rb_check_id(&sym);
if (!id) return Qnil;
#ifdef ULL2NUM
return ULL2NUM(id);
#else
return ULONG2NUM(id);
#endif
} }
void void