mirror of
https://github.com/meineerde/rackstash.git
synced 2026-02-01 01:37:12 +00:00
Use Range@cover? instead of Range#include? in FilterChain for slightly better performance
This commit is contained in:
parent
77675f65a6
commit
7ba2010412
@ -67,7 +67,7 @@ module Rackstash
|
||||
|
||||
synchronize do
|
||||
id = index_at(index)
|
||||
unless id && (0..@filters.size).include?(id)
|
||||
unless id && (0..@filters.size).cover?(id)
|
||||
raise ArgumentError, "Cannot insert at index #{index.inspect}"
|
||||
end
|
||||
|
||||
@ -185,7 +185,7 @@ module Rackstash
|
||||
|
||||
synchronize do
|
||||
id = index_at(index)
|
||||
unless id && (0...@filters.size).include?(id)
|
||||
unless id && (0...@filters.size).cover?(id)
|
||||
raise ArgumentError, "No such filter to insert after: #{index.inspect}"
|
||||
end
|
||||
|
||||
@ -215,7 +215,7 @@ module Rackstash
|
||||
|
||||
synchronize do
|
||||
id = index_at(index)
|
||||
unless id && (0...@filters.size).include?(id)
|
||||
unless id && (0...@filters.size).cover?(id)
|
||||
raise ArgumentError, "No such filter to insert before: #{index.inspect}"
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user