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 a9a43cd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/entt/entity/storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,19 @@ 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) {
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;
if(base_type::operator[](to) != tombstone) {
swap(elem, element_at(to));
return;
}

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));
}
}
Expand Down

0 comments on commit a9a43cd

Please sign in to comment.