diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-12 07:16:07 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-12 07:16:07 +0000 |
commit | 31eb48a0ac54f08a3b486cdd359b4b0d1bb9bc2f (patch) | |
tree | edbfb04b9d7d9bbe5687b1b9b3f1ba8e4eeb03c7 /enumerator.c | |
parent | c8cb0565a132f2f50f1ebd481c6b8dcec68c8c71 (diff) |
enumerator.c: Add rb_arithmetic_sequence_components_t
Add rb_arithmetic_sequence_components_t struct for encapsulating
the components of ArithmeticSequence.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r-- | enumerator.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/enumerator.c b/enumerator.c index 436541070f..d2d3b29369 100644 --- a/enumerator.c +++ b/enumerator.c @@ -2778,20 +2778,20 @@ arith_seq_exclude_end_p(VALUE self) } int -rb_arithmetic_sequence_extract(VALUE obj, VALUE *begin, VALUE *end, VALUE *step, int *exclude_end) +rb_arithmetic_sequence_extract(VALUE obj, rb_arithmetic_sequence_components_t *component) { if (rb_obj_is_kind_of(obj, rb_cArithSeq)) { - *begin = arith_seq_begin(obj); - *end = arith_seq_end(obj); - *step = arith_seq_step(obj); - *exclude_end = arith_seq_exclude_end_p(obj); + component->begin = arith_seq_begin(obj); + component->end = arith_seq_end(obj); + component->step = arith_seq_step(obj); + component->exclude_end = arith_seq_exclude_end_p(obj); return 1; } else if (rb_obj_is_kind_of(obj, rb_cRange)) { - *begin = RANGE_BEG(obj); - *end = RANGE_END(obj); - *step = INT2FIX(1); - *exclude_end = RTEST(RANGE_EXCL(obj)); + component->begin = RANGE_BEG(obj); + component->end = RANGE_END(obj); + component->step = INT2FIX(1); + component->exclude_end = RTEST(RANGE_EXCL(obj)); return 1; } |