Fix compile-time size_t narrowing to bool.
PiperOrigin-RevId: 631381101 Change-Id: I5188c352354573476decb8ae6bc007faf623a884
This commit is contained in:
committed by
Copybara-Service
parent
ad0459680d
commit
dbb258eb69
@@ -703,7 +703,7 @@ void mj_setCacheSize(mjCache cache, std::size_t size) {
|
||||
mjCache mj_globalCache() {
|
||||
// mjCCache is not trivially destructible and so the global cache needs to
|
||||
// allocated on the heap
|
||||
if constexpr (kGlobalCacheSize) {
|
||||
if constexpr (kGlobalCacheSize != 0) {
|
||||
static mjCCache* cache = new(std::nothrow) mjCCache(kGlobalCacheSize);
|
||||
return (mjCache) cache;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user