From 18e122379d218ec972250036def2c0ea7b44d710 Mon Sep 17 00:00:00 2001 From: Patrick Urbanke Date: Tue, 28 May 2024 22:35:12 +0200 Subject: [PATCH] Removed brute optimization --- include/rfl/json/read.hpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/include/rfl/json/read.hpp b/include/rfl/json/read.hpp index b36f9ef8..30bef1be 100644 --- a/include/rfl/json/read.hpp +++ b/include/rfl/json/read.hpp @@ -33,24 +33,9 @@ Result> read(const std::string& _json_str) { } yyjson_val* root = yyjson_doc_get_root(doc); const auto r = Reader(); - if constexpr (std::is_class_v && std::is_aggregate_v) { - using ProcessorsType = Processors; - alignas(T) unsigned char buf[sizeof(T)]; - auto ptr = reinterpret_cast(buf); - auto view = ProcessorsType::template process(to_view(*ptr)); - using ViewType = std::remove_cvref_t; - const auto err = Parser::read_view( - r, InputVarType(root), &view); - yyjson_doc_free(doc); - if (err) [[unlikely]] { - return *err; - } - return std::move(*ptr); - } else { - auto res = Parser>::read(r, InputVarType(root)); - yyjson_doc_free(doc); - return res; - } + auto res = Parser>::read(r, InputVarType(root)); + yyjson_doc_free(doc); + return res; } /// Parses an object from a stringstream.