From 2a6f7690927af07b80ac33db1a42859ad2c60529 Mon Sep 17 00:00:00 2001 From: skypjack Date: Fri, 31 Oct 2025 18:02:53 +0100 Subject: [PATCH] any: internal changes --- src/entt/core/any.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index adb936e85..5cf2839f4 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -450,11 +450,7 @@ public: bool assign(basic_any &&other) { // it could be a call across boundaries, but still for the same type if(other && (mode != any_policy::cref) && ((vtable == other.vtable) || has_value(other.info()))) { - if(auto *val = other.data(); val) { - return (vtable(request::transfer, *this, val) != nullptr); - } - - return (vtable(request::assign, *this, std::as_const(other).data()) != nullptr); + return (other.mode == any_policy::cref) ? (vtable(request::assign, *this, std::as_const(other).data()) != nullptr) : (vtable(request::transfer, *this, other.data()) != nullptr); } return false;