From c959d2c7c60db08e1e7b864463f1f5212c9499a2 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 14 Jun 2016 12:12:58 +0200 Subject: [PATCH] refactor(bar): Make monitor vector local --- src/bar.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/bar.cpp b/src/bar.cpp index 0a0a627d..38c5e05a 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -35,8 +35,6 @@ std::shared_ptr &get_bar() return bar; } -std::vector> monitors; - const Options& bar_opts() { return *bar->opts.get(); } @@ -56,8 +54,7 @@ Bar::Bar() : config_path(config::get_bar_path()), opts(std::make_unique auto monitor_name = config::get(this->config_path, "monitor", ""); this->opts->monitor = std::make_unique(); - if (monitors.empty()) - monitors = xlib::get_sorted_monitorlist(); + auto monitors = xlib::get_sorted_monitorlist(); // In case we're not connected to X, we'll just ignore the monitor if (!monitors.empty()) {