1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Turn nd_type_p into an inline function

This commit is contained in:
Nobuyoshi Nakada 2021-12-04 10:35:44 +09:00
parent f41b4d44f9
commit d118e7c025
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

6
node.h
View file

@ -193,7 +193,6 @@ typedef struct RNode {
#define NODE_TYPEMASK (((VALUE)0x7f)<<NODE_TYPESHIFT)
#define nd_type(n) ((int) (((n)->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 */