Skip to content

Commit

Permalink
Retains homepage and 404 hashes instead of creating a new array each …
Browse files Browse the repository at this point in the history
…time
  • Loading branch information
erwanlr committed Apr 3, 2019
1 parent e6a37f0 commit 4860c68
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/cms_scanner/target/hashes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ def non_existant_page_url
def homepage_or_404?(page)
md5sum = self.class.page_hash(page)

[homepage_hash, error_404_hash].include?(md5sum)
homepage_and_404_hashes.include?(md5sum)
end

protected

def homepage_and_404_hashes
@homepage_and_404_hashes ||= [homepage_hash, error_404_hash].freeze
end
end
end

0 comments on commit 4860c68

Please sign in to comment.