diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-17 12:03:48 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-17 12:03:48 +0000 |
commit | a22455199bf5b3ce68a6bded62a5c184373d1adb (patch) | |
tree | 9462b6f69746074cadc0c099d76d7d0c18cdeddb /internal.h | |
parent | 85473c481e3d07cf9856b1c73d7c8df1f0062bd8 (diff) | |
download | ruby-a22455199bf5b3ce68a6bded62a5c184373d1adb.tar.gz |
* internal.c: struct cmp_opt_data added for refactoring out a data
structure for CMP_OPTIMIZABLE
* array.c (struct ary_sort_data): use struct cmp_opt_data.
* enum.c (struct min_t, max_t, min_max_t): use struct cmp_opt_data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/internal.h b/internal.h index 89fcea62fd..03b1e1c3d9 100644 --- a/internal.h +++ b/internal.h @@ -685,13 +685,18 @@ enum { cmp_optimizable_count }; +struct cmp_opt_data { + int opt_methods; + int opt_inited; +}; + #define CMP_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(cmp_opt_,type)) #define CMP_OPTIMIZABLE(data, type) \ - (((data)->opt_inited & CMP_OPTIMIZABLE_BIT(type)) ? \ - ((data)->opt_methods & CMP_OPTIMIZABLE_BIT(type)) : \ - (((data)->opt_inited |= CMP_OPTIMIZABLE_BIT(type)), \ + (((data).opt_inited & CMP_OPTIMIZABLE_BIT(type)) ? \ + ((data).opt_methods & CMP_OPTIMIZABLE_BIT(type)) : \ + (((data).opt_inited |= CMP_OPTIMIZABLE_BIT(type)), \ rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \ - ((data)->opt_methods |= CMP_OPTIMIZABLE_BIT(type)))) + ((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type)))) /* ment is in method.h */ |