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

ruby-changes:68085

From: Nobuyoshi <ko1@a...>
Date: Thu, 23 Sep 2021 14:45:48 +0900 (JST)
Subject: [ruby-changes:68085] 842a4cb915 (master): Turned to_be_skipped_id to an inline function

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

From 842a4cb915e7feba6f390ad66106aaa53ed929cf Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 22 Sep 2021 23:16:27 +0900
Subject: Turned to_be_skipped_id to an inline function

---
 marshal.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/marshal.c b/marshal.c
index ab0e63c..054af9e 100644
--- a/marshal.c
+++ b/marshal.c
@@ -573,7 +573,14 @@ w_uclass(VALUE obj, VALUE super, struct dump_arg *arg) https://github.com/ruby/ruby/blob/trunk/marshal.c#L573
     }
 }
 
-#define to_be_skipped_id(id) (id == rb_id_encoding() || id == s_encoding_short || id == s_ruby2_keywords_flag || !rb_id2str(id))
+static inline bool
+to_be_skipped_id(const ID id)
+{
+    if (id == s_encoding_short) return true;
+    if (id == s_ruby2_keywords_flag) return true;
+    if (id == rb_id_encoding()) return true;
+    return !rb_id2str(id);
+}
 
 struct w_ivar_arg {
     struct dump_call_arg *dump;
-- 
cgit v1.1


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

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