Merge pull request #1970 from bdash/source_watcher-poll_once-perf
Eliminate quadratic behavior in SourceWatcher::poll_once!
This commit is contained in:
commit
c264b05906
|
@ -199,7 +199,7 @@ module Middleman
|
||||||
Contract ArrayOf[Pathname]
|
Contract ArrayOf[Pathname]
|
||||||
def poll_once!
|
def poll_once!
|
||||||
updated = ::Middleman::Util.all_files_under(@directory.to_s, &method(:should_not_recurse?))
|
updated = ::Middleman::Util.all_files_under(@directory.to_s, &method(:should_not_recurse?))
|
||||||
removed = @files.keys.reject { |p| updated.include?(p) }
|
removed = @files.keys - updated
|
||||||
|
|
||||||
result = update(updated, removed)
|
result = update(updated, removed)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue