From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4857A1F437 for ; Tue, 24 Jan 2017 23:28:07 +0000 (UTC) From: Eric Wong To: Subject: [PATCH] oldweb: use flat_map instead of flatten.map chain Date: Tue, 24 Jan 2017 23:28:07 +0000 Message-Id: <20170124232807.32115-1-e@80x24.org> List-Id: `flat_map' was introduced in Ruby 1.9.2 and reduces the amount of garbage we generate. --- lib/oldweb.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oldweb.rb b/lib/oldweb.rb index 95b7171..b1b7c46 100644 --- a/lib/oldweb.rb +++ b/lib/oldweb.rb @@ -202,7 +202,7 @@ class Oldweb return unless @store @classes = @store.all_classes_and_modules.sort @files = @store.all_files.sort - @methods = @classes.map(&:method_list).flatten.sort + @methods = @classes.flat_map(&:method_list).sort @modsort = @classes.select(&:display?).sort end -- EW