Permalink
Browse files

Range#include?: simplify condition; ref #3255

  • Loading branch information...
matz committed Nov 18, 2016
1 parent b03b1e3 commit 0ff3ae1fbaed62010c54c43235e29cdc85da2f78
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/range.c
View
@@ -230,9 +230,9 @@ mrb_range_include(mrb_state *mrb, mrb_value range)
beg = r->edges->beg;
end = r->edges->end;
include_p = r_le(mrb, beg, val) && /* beg <= val */
((r->excl && r_gt(mrb, end, val)) || /* end > val */
(!r->excl && r_ge(mrb, end, val))); /* end >= val */
include_p = r_le(mrb, beg, val) && /* beg <= val */
(r->excl ? r_gt(mrb, end, val) /* end > val */
: r_ge(mrb, end, val)); /* end >= val */
return mrb_bool_value(include_p);
}

0 comments on commit 0ff3ae1

Please sign in to comment.