Fix compile-time size_t narrowing to bool.

PiperOrigin-RevId: 631381101
Change-Id: I5188c352354573476decb8ae6bc007faf623a884
This commit is contained in:
Kyle Bayes
2024-05-07 04:58:59 -07:00
committed by Copybara-Service
parent ad0459680d
commit dbb258eb69
+1 -1
View File
@@ -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 {