From 24476c0c0baaea216d3a4756c4ebea4dfd265b1a Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 13 Apr 2012 15:34:34 +0000 Subject: * eval_error.c (error_print): use RB_TYPE_P instead of TYPE. * error.c (rb_check_backtrace): ditto. * error.c (name_err_mesg_to_str): compare immediate values directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- error.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'error.c') diff --git a/error.c b/error.c index 84286cfcec..10061b46a8 100644 --- a/error.c +++ b/error.c @@ -685,14 +685,12 @@ rb_check_backtrace(VALUE bt) static const char err[] = "backtrace must be Array of String"; if (!NIL_P(bt)) { - int t = TYPE(bt); - - if (t == T_STRING) return rb_ary_new3(1, bt); - if (t != T_ARRAY) { + if (RB_TYPE_P(bt, T_STRING)) return rb_ary_new3(1, bt); + if (!RB_TYPE_P(bt, T_ARRAY)) { rb_raise(rb_eTypeError, err); } for (i=0;i