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`,
|
# If no filters were added with `#add_example_filter`,
|
||||||
# then the returned filter will allow all examples to be run.
|
# then the returned filter will allow all examples to be run.
|
||||||
protected def example_filter
|
protected def example_filter
|
||||||
if @filters.empty?
|
case (filters = @filters)
|
||||||
NullExampleFilter.new
|
when .empty? then NullExampleFilter.new
|
||||||
else
|
when .one? then filters.first
|
||||||
CompositeExampleFilter.new(@filters)
|
else CompositeExampleFilter.new(filters)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue