diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-05-30 16:12:32 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-05-30 16:12:32 +0900 |
| commit | a4a48e3da1e65cdf1e0aaad1f5b4a83d4f91e658 (patch) | |
| tree | 6714d0d6b13719a149490db9cd7da14c5a2de32f /src | |
| parent | 0de8ffb0deee9635383a2008b3a95590775ed893 (diff) | |
| download | mruby-a4a48e3da1e65cdf1e0aaad1f5b4a83d4f91e658.tar.gz mruby-a4a48e3da1e65cdf1e0aaad1f5b4a83d4f91e658.zip | |
specify allocating array size for Hash#values
Diffstat (limited to 'src')
| -rw-r--r-- | src/hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c index 19d0507e3..777d5fc1a 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1037,7 +1037,7 @@ mrb_hash_values(mrb_state *mrb, mrb_value hash) { khash_t(ht) *h = RHASH_TBL(hash); khiter_t k; - mrb_value ary = mrb_ary_new(mrb); + mrb_value ary = mrb_ary_new_capa(mrb, kh_size(h)); if (!h) return ary; for (k = kh_begin(h); k != kh_end(h); k++) { |
