From aa8f17d847d36b2e6ab5fa9c9c764befbf6fe4e0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 12 Apr 2020 08:46:20 -0400 Subject: [PATCH] CFire: Return std::nullopt in GetTouchBounds() Avoids unnecessarily zeroing out the entire internal buffer in std::optional in some implementations (libstdc++/libc++). --- Runtime/World/CFire.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Runtime/World/CFire.hpp b/Runtime/World/CFire.hpp index f2471d3b2..357b2b89e 100644 --- a/Runtime/World/CFire.hpp +++ b/Runtime/World/CFire.hpp @@ -35,10 +35,11 @@ public: void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override; void Think(float, CStateManager&) override; std::optional GetTouchBounds() const override { - if (GetActive()) + if (GetActive()) { return x128_; + } - return {}; + return std::nullopt; } void Touch(CActor&, CStateManager&) override;