Skip to content

Commit

Permalink
remove unnecessary static check
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbgan committed Jul 11, 2023
1 parent a794a2d commit 9ffc629
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 1 addition & 7 deletions iguana/xml_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,8 @@ IGUANA_INLINE void parse_item(T &value, It &&it, It &&end,
bool parse_done = false;
// sequential parse
for_each(value, [&](const auto member_ptr, auto i) IGUANA__INLINE_LAMBDA {
static_assert(std::is_member_pointer_v<std::decay_t<decltype(member_ptr)>>,
"type must be member ptr");
using M = decltype(iguana_reflect_members(value));
using item_type = std::remove_reference_t<decltype(value.*member_ptr)>;
constexpr auto Idx = decltype(i)::value;
constexpr auto Count = M::value();
static_assert(Idx < Count);
constexpr auto mkey = M::arr()[Idx];
constexpr auto mkey = iguana::get_name<T, decltype(i)::value>();
constexpr std::string_view st_key(mkey.data(), mkey.size());
if constexpr (cdata_t<item_type>) {
return;
Expand Down
3 changes: 2 additions & 1 deletion iguana/xml_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ inline constexpr auto has_equal = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
0b0011110100111101001111010011110100111101001111010011110100111101);
};

auto has_qoute = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
inline constexpr auto has_qoute = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return has_zero(
chunk ^
0b0010001000100010001000100010001000100010001000100010001000100010);
Expand All @@ -211,6 +211,7 @@ IGUANA_INLINE void skip_sapces_and_newline(auto &&it, auto &&end) {
++it;
}
}

// match c and skip
template <char c> IGUANA_INLINE void match(auto &&it, auto &&end) {
if (it == end || *it != c) [[unlikely]] {
Expand Down

0 comments on commit 9ffc629

Please sign in to comment.