1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-10-27 05:23:39 -04:00

refactor: Pass singleton instance directly

This commit is contained in:
Michael Carlberg 2016-12-09 12:25:25 +01:00
parent 5d5542169b
commit bff119834a
3 changed files with 4 additions and 6 deletions

View file

@ -8,8 +8,7 @@ signal_receivers_t g_signal_receivers;
* Create instance
*/
signal_emitter::make_type signal_emitter::make() {
auto instance = factory_util::singleton<signal_emitter>();
return static_cast<signal_emitter&>(*instance);
return static_cast<signal_emitter&>(*factory_util::singleton<signal_emitter>());
}
POLYBAR_NS_END

View file

@ -12,8 +12,8 @@ POLYBAR_NS
* Create instance
*/
connection::make_type connection::make() {
auto instance = factory_util::singleton<connection>(xutils::get_connection(), xutils::get_connection_fd());
return static_cast<connection&>(*instance);
return static_cast<connection&>(
*factory_util::singleton<connection>(xutils::get_connection(), xutils::get_connection_fd()));
}
/**

View file

@ -12,8 +12,7 @@ POLYBAR_NS
* Create instance
*/
const xresource_manager& xresource_manager::make() {
auto instance = factory_util::singleton<xresource_manager>();
return static_cast<const xresource_manager&>(*instance);
return static_cast<const xresource_manager&>(*factory_util::singleton<xresource_manager>());
}
/**