From 3161548fbd1d1d06365f78ec89c25419c560e049 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 27 Dec 2024 21:26:31 +0100 Subject: [PATCH] Remove unnecessary guard It won't monitor anything if the array is empty --- lib/hotwire/spark/installer.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/hotwire/spark/installer.rb b/lib/hotwire/spark/installer.rb index 2bbc4c6..3b940f0 100644 --- a/lib/hotwire/spark/installer.rb +++ b/lib/hotwire/spark/installer.rb @@ -36,10 +36,8 @@ def register_monitored_paths def monitor(paths_name, action:, extensions:) monitored_paths = Hotwire::Spark.public_send(paths_name) - if monitored_paths.present? - file_watcher.monitor monitored_paths do |changed_path| - broadcast_change(monitored_paths, extensions, changed_path, action) - end + file_watcher.monitor monitored_paths do |changed_path| + broadcast_change(monitored_paths, extensions, changed_path, action) end end