Skip to content

Commit

Permalink
Small change to move var define close to use and make tracking "go" c…
Browse files Browse the repository at this point in the history
…ode easier
  • Loading branch information
rocky committed Feb 23, 2013
1 parent feefa7b commit e194ade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/columnize.rb
Expand Up @@ -122,13 +122,13 @@ def columnize(*args)
return "%s%s%s\n" % [opts[:array_prefix], l[0],
opts[:array_suffix]] if 1 == l.size

nrows = ncols = 0 # Make nrows, ncols have more global scope
colwidths = [] # Same for colwidths
if opts[:displaywidth] - opts[:lineprefix].length < 4
opts[:displaywidth] = opts[:lineprefix].length + 4
else
opts[:displaywidth] -= opts[:lineprefix].length
end
nrows = ncols = 0 # Make nrows, ncols have more global scope
colwidths = [] # Same for colwidths
if opts[:arrange_vertical]
array_index = lambda {|num_rows, row, col| num_rows*col + row }
# Try every row count from 1 upwards
Expand Down

0 comments on commit e194ade

Please sign in to comment.