Skip to content

Commit

Permalink
make Cocina::Models::Validators::DarkValidator#invalid_files a bit mo…
Browse files Browse the repository at this point in the history
…re concise/idiomatic

cribbed off this class for LanguageTagValidator, switched to something more concise for a similar method there, doing the same here

see #643
  • Loading branch information
jmartin-sul committed Nov 8, 2023
1 parent 35ef3bd commit 817b45b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/cocina/models/validators/dark_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ def dro?
end

def invalid_files
@invalid_files ||=
[].tap do |invalid_files|
files.each do |file|
invalid_files << file if invalid?(file)
end
end
@invalid_files ||= files.select { |file| invalid?(file) }
end

def invalid_filenames
Expand Down

0 comments on commit 817b45b

Please sign in to comment.