[前][次][番号順一覧][スレッド一覧]

ruby-changes:64756

From: Nobuyoshi <ko1@a...>
Date: Tue, 5 Jan 2021 21:47:41 +0900 (JST)
Subject: [ruby-changes:64756] 4272395982 (master): [ruby/io-console] Pre-define chomp! ID

https://git.ruby-lang.org/ruby.git/commit/?id=4272395982

From 4272395982dc442dbd38fef514116e0bad9f9303 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 5 Jan 2021 16:29:00 +0900
Subject: [ruby/io-console] Pre-define chomp! ID

https://github.com/ruby/io-console/commit/028e1c9497

diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index e034079..3496a63 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -77,7 +77,7 @@ getattr(int fd, conmode *t) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L77
 
 static ID id_getc, id_console, id_close, id_min, id_time, id_intr;
 #if ENABLE_IO_GETPASS
-static ID id_gets;
+static ID id_gets, id_chomp_bang;
 #endif
 
 #ifdef HAVE_RB_SCHEDULER_TIMEOUT
@@ -1562,7 +1562,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L1562
 str_chomp(VALUE str)
 {
     if (!NIL_P(str)) {
-	rb_funcallv(str, rb_intern("chomp!"), 0, 0);
+	rb_funcallv(str, id_chomp_bang, 0, 0);
     }
     return str;
 }
@@ -1622,6 +1622,7 @@ Init_console(void) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L1622
     id_getc = rb_intern("getc");
 #if ENABLE_IO_GETPASS
     id_gets = rb_intern("gets");
+    id_chomp_bang = rb_intern("chomp!");
 #endif
     id_console = rb_intern("console");
     id_close = rb_intern("close");
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]