From d118e7c025adf0221fe16ad3a0d57ba9605fd2a7 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 4 Dec 2021 10:35:44 +0900 Subject: [PATCH] Turn nd_type_p into an inline function --- node.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node.h b/node.h index b2687aed13..4251638fb3 100644 --- a/node.h +++ b/node.h @@ -193,7 +193,6 @@ typedef struct RNode { #define NODE_TYPEMASK (((VALUE)0x7f)<flags & NODE_TYPEMASK)>>NODE_TYPESHIFT)) -#define nd_type_p(n, t) (nd_type((n)) == (t)) #define nd_set_type(n,t) \ rb_node_set_type(n, t) #define nd_init_type(n,t) \ @@ -498,6 +497,11 @@ rb_node_set_type(NODE *n, enum node_type t) return nd_init_type(n, t); } +static inline bool +nd_type_p(const NODE *n, enum node_type t) +{ + return (enum node_type)nd_type(n) == t; +} #if defined(__cplusplus) #if 0 { /* satisfy cc-mode */