* [PATCH] oldweb: use flat_map instead of flatten.map chain
@ 2017-01-24 23:28 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2017-01-24 23:28 UTC (permalink / raw)
To: olddoc-public
`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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-24 23:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 23:28 [PATCH] oldweb: use flat_map instead of flatten.map chain Eric Wong
Code repositories for project(s) associated with this public inbox
http://80x24.org/olddoc.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).