Skip to content

Commit

Permalink
storage: try to address wrong code coverage results by lcov2
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Dec 23, 2024
1 parent 15fe6fe commit 0ec1ebd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/entt/entity/storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,20 @@ class basic_storage: public basic_sparse_set<Entity, typename std::allocator_tra
ENTT_ASSERT((from + 1u) && !is_pinned_type, "Pinned type");

if constexpr(!is_pinned_type) {
using std::swap;
auto &elem = element_at(from);

if constexpr(traits_type::in_place_delete) {
if(base_type::operator[](to) == tombstone) {
const auto entt = base_type::operator[](to);

if(entt == tombstone) {
allocator_type allocator{get_allocator()};
entt::uninitialized_construct_using_allocator(to_address(assure_at_least(to)), allocator, std::move(elem));
alloc_traits::destroy(allocator, std::addressof(elem));
} else {
using std::swap;
swap(elem, element_at(to));
}
} else {
using std::swap;
swap(elem, element_at(to));
}
}
Expand Down

0 comments on commit 0ec1ebd

Please sign in to comment.