1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-29 23:32:23 +00:00

erpt: save 8KB

This commit is contained in:
Michael Scire 2021-10-07 19:14:31 -07:00
parent e7ca22abd7
commit afccc35e79

View file

@ -73,7 +73,19 @@ namespace ams::erpt::srv {
} }
bool IsProductionMode() { bool IsProductionMode() {
static bool s_is_prod_mode = IsProductionModeImpl(); static constinit bool s_initialized = false;
static constinit bool s_is_prod_mode = true;
static constinit os::SdkMutex s_mutex;
if (AMS_UNLIKELY(!s_initialized)) {
std::scoped_lock lk(s_mutex);
if (AMS_LIKELY(!s_initialized)) {
s_is_prod_mode = IsProductionModeImpl();
s_initialized = true;
}
}
return s_is_prod_mode; return s_is_prod_mode;
} }