diff --git a/lib/yoga/src/main/cpp/yoga/style/StyleValuePool.h b/lib/yoga/src/main/cpp/yoga/style/StyleValuePool.h index 597eae4c437..ddb0d253630 100644 --- a/lib/yoga/src/main/cpp/yoga/style/StyleValuePool.h +++ b/lib/yoga/src/main/cpp/yoga/style/StyleValuePool.h @@ -49,9 +49,11 @@ class StyleValuePool { StyleLength getLength(StyleValueHandle handle) const { if (handle.isUndefined()) { - return StyleLength::undefined(); + static const StyleLength undefined = StyleLength::undefined(); + return undefined; } else if (handle.isAuto()) { - return StyleLength::ofAuto(); + static const StyleLength ofAuto = StyleLength::ofAuto(); + return ofAuto; } else { assert( handle.type() == StyleValueHandle::Type::Point ||