Skip to content

Commit

Permalink
improve speed by replacing Array#select with iterating over existing …
Browse files Browse the repository at this point in the history
…wal files and break from loop if needed wal file is found
  • Loading branch information
hamann committed Nov 29, 2013
1 parent c87df96 commit b64c9e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/rbarman/backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,13 @@ def needed_wal_files
def missing_wal_files
missing = Array.new
needed_wal_files.each do |needed|
existing = @wal_files.select { |f| f == needed }.first
existing = nil
@wal_files.each do |f|
if f == needed
existing = f
break
end
end
missing << needed unless existing
end
WalFiles.new(missing)
Expand Down
2 changes: 1 addition & 1 deletion lib/rbarman/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RBarman
VERSION = "0.0.10"
VERSION = "0.0.11"
end

0 comments on commit b64c9e8

Please sign in to comment.