summaryrefslogtreecommitdiffhomepage
path: root/src/array.c
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-08-05 12:41:15 +0900
committerKOBAYASHI Shuji <[email protected]>2019-08-05 13:18:50 +0900
commit334afb167c0a1fa478a53c3844f37c0f1fd866dd (patch)
treecf67a9759a8608edbe1cad3146c155852445bc1d /src/array.c
parent0e2e8b79d327da9b2ba0ce42e02cf6653c3e3fae (diff)
downloadmruby-334afb167c0a1fa478a53c3844f37c0f1fd866dd.tar.gz
mruby-334afb167c0a1fa478a53c3844f37c0f1fd866dd.zip
Use new specifiers/modifiers of `mrb_vfromat()`
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in my environment than before the introduction of new specifiers/modifiers (5116789a) with this change. ------------+-------------------+-------------------+-------- BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO ------------+-------------------+-------------------+-------- mruby | 593416 bytes | 593208 bytes | -0.04% libmruby.a | 769048 bytes | 767264 bytes | -0.23% ------------+-------------------+-------------------+-------- BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613, so I put it back.
Diffstat (limited to 'src/array.c')
-rw-r--r--src/array.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/array.c b/src/array.c
index 8cf813743..06c23dcd3 100644
--- a/src/array.c
+++ b/src/array.c
@@ -668,7 +668,7 @@ mrb_ary_set(mrb_state *mrb, mrb_value ary, mrb_int n, mrb_value val)
if (n < 0) {
n += len;
if (n < 0) {
- mrb_raisef(mrb, E_INDEX_ERROR, "index %S out of array", mrb_fixnum_value(n - len));
+ mrb_raisef(mrb, E_INDEX_ERROR, "index %i out of array", n - len);
}
}
if (len <= n) {
@@ -700,7 +700,7 @@ mrb_ary_splice(mrb_state *mrb, mrb_value ary, mrb_int head, mrb_int len, mrb_val
ary_modify(mrb, a);
/* len check */
- if (len < 0) mrb_raisef(mrb, E_INDEX_ERROR, "negative length (%S)", mrb_fixnum_value(len));
+ if (len < 0) mrb_raisef(mrb, E_INDEX_ERROR, "negative length (%i)", len);
/* range check */
if (head < 0) {
@@ -734,7 +734,7 @@ mrb_ary_splice(mrb_state *mrb, mrb_value ary, mrb_int head, mrb_int len, mrb_val
}
if (head >= alen) {
if (head > ARY_MAX_SIZE - argc) {
- mrb_raisef(mrb, E_INDEX_ERROR, "index %S too big", mrb_fixnum_value(head));
+ mrb_raisef(mrb, E_INDEX_ERROR, "index %i too big", head);
}
len = head + argc;
if (len > ARY_CAPA(a)) {
@@ -750,7 +750,7 @@ mrb_ary_splice(mrb_state *mrb, mrb_value ary, mrb_int head, mrb_int len, mrb_val
mrb_int newlen;
if (alen - len > ARY_MAX_SIZE - argc) {
- mrb_raisef(mrb, E_INDEX_ERROR, "index %S too big", mrb_fixnum_value(alen + argc - len));
+ mrb_raisef(mrb, E_INDEX_ERROR, "index %i too big", alen + argc - len);
}
newlen = alen + argc - len;
if (newlen > ARY_CAPA(a)) {
@@ -934,7 +934,7 @@ mrb_ary_aset(mrb_state *mrb, mrb_value self)
mrb_ary_splice(mrb, self, i, len, v2);
break;
case MRB_RANGE_OUT:
- mrb_raisef(mrb, E_RANGE_ERROR, "%S out of range", v1);
+ mrb_raisef(mrb, E_RANGE_ERROR, "%v out of range", v1);
break;
}
return v2;