ruby-changes:71915
From: Nobuyoshi <ko1@a...>
Date: Sun, 22 May 2022 01:12:27 +0900 (JST)
Subject: [ruby-changes:71915] 7e52533104 (master): No fallback to default values
https://git.ruby-lang.org/ruby.git/commit/?id=7e52533104 From 7e52533104f1b67c06c817384416fe011a25eaaf Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 21 May 2022 22:58:45 +0900 Subject: No fallback to default values --- error.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/error.c b/error.c index 24df7ce064..4c501f1446 100644 --- a/error.c +++ b/error.c @@ -1269,13 +1269,12 @@ check_highlight_keyword(VALUE opt, int auto_tty_detect) https://github.com/ruby/ruby/blob/trunk/error.c#L1269 VALUE highlight = Qnil; if (!NIL_P(opt)) { - highlight = rb_hash_aref(opt, sym_highlight); + highlight = rb_hash_lookup(opt, sym_highlight); switch (highlight) { default: rb_bool_expected(highlight, "highlight"); UNREACHABLE; - case Qundef: highlight = Qnil; break; case Qtrue: case Qfalse: case Qnil: break; } } @@ -1301,7 +1300,7 @@ check_order_keyword(VALUE opt) https://github.com/ruby/ruby/blob/trunk/error.c#L1300 static VALUE kw_order; if (!kw_order) kw_order = ID2SYM(rb_intern_const("order")); - order = rb_hash_aref(opt, kw_order); + order = rb_hash_lookup(opt, kw_order); if (order != Qnil) { ID id = rb_check_id(&order); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/