{"height":"190","provider_name":"Hatena Blog","image_url":null,"description":"Array#replace \u306f a = [1, 2, 3] a.replace [4, 5, 6] \u3068\u304b\u3063\u3066\u4f7f\u3046\u3089\u3057\u3044\u3093\u3060\u3051\u3069 \u3053\u308c\u3063\u3066 a = [1, 2, 3] a = [4, 5, 6] \u3063\u3066\u3084\u3063\u3066\u3082\u7d50\u679c\u306f\u540c\u3058\u3060\u3068\u601d\u3046\u3093\u3060\u3088\u306d\u3002 \u30d9\u30f3\u30c1\u30de\u30fc\u30af\u53d6\u3063\u3066\u307f\u3066\u3082 require 'benchmark' num = 100000 Benchmark.bmbm(10) do |x| x.report(\"replace\") { num.times do a = [1, 2, 3] a.replace [4, 5, 6] end } x.report(\"not replace\") { num.times\u2026","author_name":"gan2","url":"https://gan2-2.hatenadiary.org/entry/20080609/1212999907","blog_title":"gan2 \u306e Ruby \u52c9\u5f37\u65e5\u8a18","categories":["Ruby"],"provider_url":"https://hatena.blog","published":"2008-06-09 17:25:07","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgan2-2.hatenadiary.org%2Fentry%2F20080609%2F1212999907\" title=\" Array#replace \u3063\u3066\u4f55\u304c\u4fbf\u5229\u306a\u306e\uff1f - gan2 \u306e Ruby \u52c9\u5f37\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":" Array#replace \u3063\u3066\u4f55\u304c\u4fbf\u5229\u306a\u306e\uff1f","type":"rich","author_url":"https://blog.hatena.ne.jp/gan2/","blog_url":"https://gan2-2.hatenadiary.org/","version":"1.0"}