From 5b0f900faacee1a7c5cdc01a979fce0157a2207e Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Mon, 7 Jul 2014 21:58:38 +0900 Subject: Remove unnecessary out of memory check in `ary_expand_capa`. Since `mrb_realloc` raises when failed to allocate memory. --- src/array.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/array.c') diff --git a/src/array.c b/src/array.c index 600db7488..a016c225b 100644 --- a/src/array.c +++ b/src/array.c @@ -200,10 +200,6 @@ ary_expand_capa(mrb_state *mrb, struct RArray *a, mrb_int len) if (capa > a->aux.capa) { mrb_value *expanded_ptr = (mrb_value *)mrb_realloc(mrb, a->ptr, sizeof(mrb_value)*capa); - if (!expanded_ptr) { - mrb_raise(mrb, E_RUNTIME_ERROR, "out of memory"); - } - a->aux.capa = capa; a->ptr = expanded_ptr; } -- cgit v1.2.3