RHASH_EMPTY_P: convert into an inline function
This commit is contained in:
parent
99093e1600
commit
8cc5f74ffc
Notes:
git
2020-08-19 15:11:26 +09:00
@ -47,6 +47,7 @@
|
|||||||
#undef RHASH_IFNONE
|
#undef RHASH_IFNONE
|
||||||
#undef RHASH_SIZE
|
#undef RHASH_SIZE
|
||||||
#undef RHASH_TBL
|
#undef RHASH_TBL
|
||||||
|
#undef RHASH_EMPTY_P
|
||||||
|
|
||||||
/* internal/object.h */
|
/* internal/object.h */
|
||||||
#undef ROBJECT_IV_INDEX_TBL
|
#undef ROBJECT_IV_INDEX_TBL
|
||||||
|
@ -64,6 +64,10 @@ struct RHash {
|
|||||||
# undef RHASH_SIZE
|
# undef RHASH_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef RHASH_EMPTY_P
|
||||||
|
# undef RHASH_EMPTY_P
|
||||||
|
#endif
|
||||||
|
|
||||||
/* hash.c */
|
/* hash.c */
|
||||||
void rb_hash_st_table_set(VALUE hash, st_table *st);
|
void rb_hash_st_table_set(VALUE hash, st_table *st);
|
||||||
VALUE rb_hash_default_value(VALUE hash, VALUE key);
|
VALUE rb_hash_default_value(VALUE hash, VALUE key);
|
||||||
@ -82,6 +86,7 @@ int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func *fu
|
|||||||
static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h);
|
static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h);
|
||||||
static inline VALUE RHASH_IFNONE(VALUE h);
|
static inline VALUE RHASH_IFNONE(VALUE h);
|
||||||
static inline size_t RHASH_SIZE(VALUE h);
|
static inline size_t RHASH_SIZE(VALUE h);
|
||||||
|
static inline bool RHASH_EMPTY_P(VALUE h);
|
||||||
static inline bool RHASH_AR_TABLE_P(VALUE h);
|
static inline bool RHASH_AR_TABLE_P(VALUE h);
|
||||||
static inline bool RHASH_ST_TABLE_P(VALUE h);
|
static inline bool RHASH_ST_TABLE_P(VALUE h);
|
||||||
static inline struct ar_table_struct *RHASH_AR_TABLE(VALUE h);
|
static inline struct ar_table_struct *RHASH_AR_TABLE(VALUE h);
|
||||||
@ -173,6 +178,12 @@ RHASH_SIZE(VALUE h)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
RHASH_EMPTY_P(VALUE h)
|
||||||
|
{
|
||||||
|
return RHASH_SIZE(h) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
RHASH_ST_TABLE_P(VALUE h)
|
RHASH_ST_TABLE_P(VALUE h)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user