Skip to content

Commit

Permalink
lib/wirble.rb (save_history): Less (visual) clutter...
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwinter committed Nov 20, 2009
1 parent acba979 commit 5251c81
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/wirble.rb
Expand Up @@ -89,15 +89,9 @@ def save_history
# read lines from history, and truncate the list (if necessary)
lines = Readline::HISTORY.to_a

if uniq
if uniq.to_s == 'reverse'
lines.reverse!
lines.uniq!
lines.reverse!
else
lines.uniq!
end
end
lines.reverse! if reverse = uniq.to_s == 'reverse'
lines.uniq! if uniq
lines.reverse! if reverse

lines.slice!(0, lines.size - max_size) if lines.size > max_size

Expand Down

0 comments on commit 5251c81

Please sign in to comment.