refactor: Pass singleton instance directly
This commit is contained in:
parent
5d5542169b
commit
bff119834a
@ -8,8 +8,7 @@ signal_receivers_t g_signal_receivers;
|
|||||||
* Create instance
|
* Create instance
|
||||||
*/
|
*/
|
||||||
signal_emitter::make_type signal_emitter::make() {
|
signal_emitter::make_type signal_emitter::make() {
|
||||||
auto instance = factory_util::singleton<signal_emitter>();
|
return static_cast<signal_emitter&>(*factory_util::singleton<signal_emitter>());
|
||||||
return static_cast<signal_emitter&>(*instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
POLYBAR_NS_END
|
POLYBAR_NS_END
|
||||||
|
@ -12,8 +12,8 @@ POLYBAR_NS
|
|||||||
* Create instance
|
* Create instance
|
||||||
*/
|
*/
|
||||||
connection::make_type connection::make() {
|
connection::make_type connection::make() {
|
||||||
auto instance = factory_util::singleton<connection>(xutils::get_connection(), xutils::get_connection_fd());
|
return static_cast<connection&>(
|
||||||
return static_cast<connection&>(*instance);
|
*factory_util::singleton<connection>(xutils::get_connection(), xutils::get_connection_fd()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,8 +12,7 @@ POLYBAR_NS
|
|||||||
* Create instance
|
* Create instance
|
||||||
*/
|
*/
|
||||||
const xresource_manager& xresource_manager::make() {
|
const xresource_manager& xresource_manager::make() {
|
||||||
auto instance = factory_util::singleton<xresource_manager>();
|
return static_cast<const xresource_manager&>(*factory_util::singleton<xresource_manager>());
|
||||||
return static_cast<const xresource_manager&>(*instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user