Skip to content

Commit

Permalink
fixed warning
Browse files Browse the repository at this point in the history
  • Loading branch information
teseoch committed Jan 18, 2024
1 parent 786bbe3 commit 15c7a7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/wmtk/attribute/MeshAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,18 @@ bool MeshAttributes<T>::has_attribute(const std::string& name) const
template <typename T>
bool MeshAttributes<T>::operator==(const MeshAttributes<T>& other) const
{
if(m_handles != other.m_handles) {
if (m_handles != other.m_handles) {
return false;
}
if(m_attributes.size() != other.m_attributes.size()) {
if (m_attributes.size() != other.m_attributes.size()) {
return false;
}
for(size_t j = 0; j < m_attributes.size(); ++j) {
if(!(*m_attributes[j] == *other.m_attributes[j]) ){
for (size_t j = 0; j < m_attributes.size(); ++j) {
if (!(*m_attributes[j] == *other.m_attributes[j])) {
return false;
}
}
return true;
return true;
}


Expand Down Expand Up @@ -186,6 +186,8 @@ size_t MeshAttributes<T>::attribute_count() const
template <typename T>
void MeshAttributes<T>::reserve(const int64_t size)
{
assert(size >= m_reserved_size);

m_reserved_size = size;
for (auto& attr_ptr : m_attributes) {
attr_ptr->reserve(size);
Expand Down
3 changes: 1 addition & 2 deletions src/wmtk/operations/Operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ bool Operation::after(

void Operation::apply_attribute_transfer(const std::vector<simplex::Simplex>& direct_mods)
{
// TODO: this has no chance of working in multimesh
simplex::SimplexCollection all(m_mesh);
for (const auto& s : direct_mods) {
all.add(simplex::closed_star(m_mesh, s, false));
Expand Down Expand Up @@ -168,7 +167,7 @@ void Operation::reserve_enough_simplices()
for (auto& v : cap) {
v *= default_preallocation_size;
}
m.guarantee_at_least_attributes(cap);
m.reserve_more_attributes(cap);
}
};
multimesh::MultiMeshVisitor visitor(run);
Expand Down

0 comments on commit 15c7a7e

Please sign in to comment.