From d2af423057d1dc4d08c662445a9abb54e6696f6c Mon Sep 17 00:00:00 2001 From: rexy712 Date: Mon, 3 Aug 2020 17:39:27 -0700 Subject: [PATCH] Work with rexylib after small string optimization --- rjp++/include/object.hpp | 2 +- rjp++/src/object.cpp | 2 +- rjp++/src/string.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rjp++/include/object.hpp b/rjp++/include/object.hpp index 48b4d4c..19ec821 100644 --- a/rjp++/include/object.hpp +++ b/rjp++/include/object.hpp @@ -138,7 +138,7 @@ namespace rjp{ private: RJP_value* add_member_impl(const rexy::string_base& key); - RJP_value* add_member_impl(rexy::string_base&& key); + RJP_value* add_member_impl(string&& key); }; } diff --git a/rjp++/src/object.cpp b/rjp++/src/object.cpp index 34388f7..0730425 100644 --- a/rjp++/src/object.cpp +++ b/rjp++/src/object.cpp @@ -130,7 +130,7 @@ namespace rjp{ RJP_value* object::add_member_impl(const rexy::string_base& key){ return rjp_new_member(m_value, key.get(), key.length()); } - RJP_value* object::add_member_impl(rexy::string_base&& key){ + RJP_value* object::add_member_impl(string&& key){ auto length = key.length(); return rjp_new_member_steal_key(m_value, key.release(), length); } diff --git a/rjp++/src/string.cpp b/rjp++/src/string.cpp index 79bac01..a2d9afb 100644 --- a/rjp++/src/string.cpp +++ b/rjp++/src/string.cpp @@ -40,9 +40,9 @@ namespace rjp{ return *this; reset(); RJP_string* str = rjp_get_string(r); - m_data = std::exchange(str->value, nullptr); - m_length = str->length; - m_cap = str->length; + set_long_ptr(std::exchange(str->value, nullptr)); + set_long_length(str->length); + set_long_capacity(str->length); str->length = 0; return *this; }