Skip to content

Commit 21ac61a

Browse files
committed
helper: suppress a warning from the linter (waiting for C++20)
1 parent 9d00adf commit 21ac61a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

TODO

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ DOC:
1010
* bump entities, reserved bits on identifiers
1111

1212
TODO:
13+
* review all NOLINT
1314
* bring nested groups back in place (see bd34e7f)
1415
* work stealing job system (see #100) + mt scheduler based on const awareness for types
1516
* view: reduce inst due to/improve perf with index-based approach in dispatch_get/pick_and_each/each (single type too, define storage ::at and ::at_as_tuple)

src/entt/entity/helper.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,15 @@ template<typename... Args>
126126
typename basic_storage<Args...>::entity_type to_entity(const basic_storage<Args...> &storage, const typename basic_storage<Args...>::value_type &instance) {
127127
using traits_type = component_traits<typename basic_storage<Args...>::value_type, typename basic_storage<Args...>::entity_type>;
128128
static_assert(traits_type::page_size != 0u, "Unexpected page size");
129-
130-
131-
132-
133129
const auto *page = storage.raw();
134130

131+
// NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic)
135132
for(std::size_t pos{}, count = storage.size(); pos < count; pos += traits_type::page_size, ++page) {
136133
if(const auto dist = (std::addressof(instance) - *page); dist >= 0 && dist < static_cast<decltype(dist)>(traits_type::page_size)) {
137134
return *(static_cast<const typename basic_storage<Args...>::base_type &>(storage).rbegin() + static_cast<decltype(dist)>(pos) + dist);
138135
}
139136
}
137+
// NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic)
140138

141139
return null;
142140
}

0 commit comments

Comments
 (0)