mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
small cosmetic changes.
I prefer `i++` style unless absolutely necessary. This commit is an addition to 41e4148.
This commit is contained in:
@@ -33,7 +33,7 @@ mrb_ary_assoc(mrb_state *mrb, mrb_value ary)
|
||||
mrb_value v;
|
||||
mrb_value k = mrb_get_arg1(mrb);
|
||||
|
||||
for (i = 0; i < RARRAY_LEN(ary); ++i) {
|
||||
for (i = 0; i < RARRAY_LEN(ary); i++) {
|
||||
v = mrb_check_array_type(mrb, RARRAY_PTR(ary)[i]);
|
||||
if (!mrb_nil_p(v) && RARRAY_LEN(v) > 0 &&
|
||||
mrb_equal(mrb, RARRAY_PTR(v)[0], k))
|
||||
@@ -63,7 +63,7 @@ mrb_ary_rassoc(mrb_state *mrb, mrb_value ary)
|
||||
mrb_value v;
|
||||
mrb_value value = mrb_get_arg1(mrb);
|
||||
|
||||
for (i = 0; i < RARRAY_LEN(ary); ++i) {
|
||||
for (i = 0; i < RARRAY_LEN(ary); i++) {
|
||||
v = RARRAY_PTR(ary)[i];
|
||||
if (mrb_array_p(v) &&
|
||||
RARRAY_LEN(v) > 1 &&
|
||||
@@ -167,9 +167,9 @@ mrb_ary_slice_bang(mrb_state *mrb, mrb_value self)
|
||||
ptr = ARY_PTR(a) + i;
|
||||
ary = mrb_ary_new_from_values(mrb, len, ptr);
|
||||
|
||||
for (j = i; j < alen - len; ++j) {
|
||||
for (j = i; j < alen - len; j++) {
|
||||
*ptr = *(ptr+len);
|
||||
++ptr;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
mrb_ary_resize(mrb, self, alen - len);
|
||||
@@ -193,7 +193,7 @@ mrb_ary_compact(mrb_state *mrb, mrb_value self)
|
||||
mrb_int len = RARRAY_LEN(self);
|
||||
mrb_value *p = RARRAY_PTR(self);
|
||||
|
||||
for (mrb_int i = 0; i < len; ++i) {
|
||||
for (mrb_int i = 0; i < len; i++) {
|
||||
if (!mrb_nil_p(p[i])) {
|
||||
mrb_ary_push(mrb, ary, p[i]);
|
||||
}
|
||||
@@ -221,7 +221,7 @@ mrb_ary_compact_bang(mrb_state *mrb, mrb_value self)
|
||||
mrb_value *p = ARY_PTR(a);
|
||||
|
||||
mrb_ary_modify(mrb, a);
|
||||
for (i = 0; i < len; ++i) {
|
||||
for (i = 0; i < len; i++) {
|
||||
if (!mrb_nil_p(p[i])) {
|
||||
if (i != j) p[j] = p[i];
|
||||
j++;
|
||||
|
||||
Reference in New Issue
Block a user