mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use filter if only one is provided
This is less overhead than creating a composite filter for one child filter.
This commit is contained in:
parent
83d7657b18
commit
e7c3d8f060
1 changed files with 4 additions and 4 deletions
|
@ -156,10 +156,10 @@ module Spectator
|
|||
# If no filters were added with `#add_example_filter`,
|
||||
# then the returned filter will allow all examples to be run.
|
||||
protected def example_filter
|
||||
if @filters.empty?
|
||||
NullExampleFilter.new
|
||||
else
|
||||
CompositeExampleFilter.new(@filters)
|
||||
case (filters = @filters)
|
||||
when .empty? then NullExampleFilter.new
|
||||
when .one? then filters.first
|
||||
else CompositeExampleFilter.new(filters)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue