From bff119834a91d4ae7aead36506bc700e2b20302f Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 9 Dec 2016 12:25:25 +0100 Subject: [PATCH] refactor: Pass singleton instance directly --- src/events/signal_emitter.cpp | 3 +-- src/x11/connection.cpp | 4 ++-- src/x11/xresources.cpp | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/events/signal_emitter.cpp b/src/events/signal_emitter.cpp index c45d7ec1..0a87b8d7 100644 --- a/src/events/signal_emitter.cpp +++ b/src/events/signal_emitter.cpp @@ -8,8 +8,7 @@ signal_receivers_t g_signal_receivers; * Create instance */ signal_emitter::make_type signal_emitter::make() { - auto instance = factory_util::singleton(); - return static_cast(*instance); + return static_cast(*factory_util::singleton()); } POLYBAR_NS_END diff --git a/src/x11/connection.cpp b/src/x11/connection.cpp index 349fa42c..7d50bedf 100644 --- a/src/x11/connection.cpp +++ b/src/x11/connection.cpp @@ -12,8 +12,8 @@ POLYBAR_NS * Create instance */ connection::make_type connection::make() { - auto instance = factory_util::singleton(xutils::get_connection(), xutils::get_connection_fd()); - return static_cast(*instance); + return static_cast( + *factory_util::singleton(xutils::get_connection(), xutils::get_connection_fd())); } /** diff --git a/src/x11/xresources.cpp b/src/x11/xresources.cpp index 865d8a9c..c79e8e17 100644 --- a/src/x11/xresources.cpp +++ b/src/x11/xresources.cpp @@ -12,8 +12,7 @@ POLYBAR_NS * Create instance */ const xresource_manager& xresource_manager::make() { - auto instance = factory_util::singleton(); - return static_cast(*instance); + return static_cast(*factory_util::singleton()); } /**