You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.4 KiB
65 lines
2.4 KiB
From f0d0ef4007c64a5a91146d834375a1684d27241c Mon Sep 17 00:00:00 2001 |
|
From: =?UTF-8?q?Pawe=C5=82=20Per=C5=82akowski?= <pawel@ok.info.pl> |
|
Date: Tue, 25 Feb 2025 17:39:39 +0100 |
|
Subject: [PATCH 8/9] Faster track for lightuserdata_value |
|
|
|
--- |
|
include/sol/stack_check_qualified.hpp | 2 +- |
|
include/sol/stack_check_unqualified.hpp | 4 +--- |
|
include/sol/stack_core.hpp | 5 ++--- |
|
3 files changed, 4 insertions(+), 7 deletions(-) |
|
|
|
diff --git include/sol/stack_check_qualified.hpp include/sol/stack_check_qualified.hpp |
|
index cc2394af..3ce5b642 100644 |
|
--- include/sol/stack_check_qualified.hpp |
|
+++ include/sol/stack_check_qualified.hpp |
|
@@ -28,7 +28,7 @@ |
|
|
|
namespace sol { namespace stack { |
|
|
|
- template <typename X, type expected, typename> |
|
+ template <typename X, typename> |
|
struct qualified_checker { |
|
template <typename Handler> |
|
static bool check(lua_State* L, int index, Handler&& handler, record& tracking) { |
|
diff --git include/sol/stack_check_unqualified.hpp include/sol/stack_check_unqualified.hpp |
|
index d75557c4..18974987 100644 |
|
--- include/sol/stack_check_unqualified.hpp |
|
+++ include/sol/stack_check_unqualified.hpp |
|
@@ -389,9 +389,7 @@ namespace sol { namespace stack { |
|
return success; |
|
} |
|
else if constexpr (meta::is_specialization_of_v<T, user>) { |
|
- unqualified_checker<lightuserdata_value, type::userdata> c; |
|
- (void)c; |
|
- return c.check(L_, index, std::forward<Handler>(handler), tracking); |
|
+ return stack::unqualified_check<detail::as_value_tag<lightuserdata_value>>(L_, index, std::forward<Handler>(handler), tracking); |
|
} |
|
else { |
|
if constexpr (std::is_pointer_v<T>) { |
|
diff --git include/sol/stack_core.hpp include/sol/stack_core.hpp |
|
index c4f5e203..2ce3ca2b 100644 |
|
--- include/sol/stack_core.hpp |
|
+++ include/sol/stack_core.hpp |
|
@@ -571,7 +571,7 @@ namespace sol { |
|
|
|
template <typename T, type t, typename = void> |
|
struct unqualified_checker; |
|
- template <typename T, type t, typename = void> |
|
+ template <typename T, typename = void> |
|
struct qualified_checker; |
|
|
|
template <typename T, typename = void> |
|
@@ -1002,8 +1002,7 @@ namespace sol { |
|
return sol_lua_check(types<T>(), L, index, std::forward<Handler>(handler), tracking); |
|
} |
|
else { |
|
- using Tu = meta::unqualified_t<T>; |
|
- qualified_checker<T, lua_type_of_v<Tu>> c{}; |
|
+ qualified_checker<T> c{}; |
|
return c.check(L, index, std::forward<Handler>(handler), tracking); |
|
} |
|
} |
|
-- |
|
2.48.1 |
|
|
|
|