[logaling-commit] logaling/logaling-command [master] Use max instead of sort.last

Back to archive index

null+****@clear***** null+****@clear*****
Fri Jul 20 16:32:39 JST 2012


SHIMADA Koji	2012-07-20 16:32:39 +0900 (Fri, 20 Jul 2012)

  New Revision: 575c3c7987ddd1e26289058254d76f304bb1592d
  https://github.com/logaling/logaling-command/commit/575c3c7987ddd1e26289058254d76f304bb1592d

  Merged c54901b: Merge pull request #72 from logaling/fix-format-output

  Log:
    Use max instead of sort.last

  Modified files:
    lib/logaling/command/renderers.rb

  Modified: lib/logaling/command/renderers.rb (+1 -3)
===================================================================
--- lib/logaling/command/renderers.rb    2012-07-20 16:31:25 +0900 (6f9e152)
+++ lib/logaling/command/renderers.rb    2012-07-20 16:32:39 +0900 (dc7d37b)
@@ -103,9 +103,7 @@ module Logaling::Command
       end
 
       def set_max_source_term_width(terms)
-        @max_source_term_width = terms.map{|term|
-          string_display_width(term[:source_term])
-        }.sort.last
+        @max_source_term_width = terms.map{|term| string_display_width(term[:source_term]) }.max
       end
 
       private
-------------- next part --------------
An HTML attachment was scrubbed...
Download 



More information about the logaling-commit mailing list
Back to archive index