ruby-changes:72059
From: Nobuyoshi <ko1@a...>
Date: Sun, 5 Jun 2022 15:18:27 +0900 (JST)
Subject: [ruby-changes:72059] ed2dd17294 (master): Use RBOOL
https://git.ruby-lang.org/ruby.git/commit/?id=ed2dd17294 From ed2dd17294162f996eec15c4c35d2688ed529629 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 5 Jun 2022 14:21:01 +0900 Subject: Use RBOOL --- error.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/error.c b/error.c index 4c501f1446..3f5c05d681 100644 --- a/error.c +++ b/error.c @@ -1280,12 +1280,7 @@ check_highlight_keyword(VALUE opt, int auto_tty_detect) https://github.com/ruby/ruby/blob/trunk/error.c#L1280 } if (NIL_P(highlight)) { - if (auto_tty_detect) { - highlight = rb_stderr_tty_p() ? Qtrue : Qfalse; - } - else { - highlight = Qfalse; - } + highlight = RBOOL(auto_tty_detect && rb_stderr_tty_p()); } return highlight; -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/