diff --git a/lib/include/pl/patterns/pattern_array_dynamic.hpp b/lib/include/pl/patterns/pattern_array_dynamic.hpp index 4e7f14e8..d76714bc 100644 --- a/lib/include/pl/patterns/pattern_array_dynamic.hpp +++ b/lib/include/pl/patterns/pattern_array_dynamic.hpp @@ -51,12 +51,8 @@ namespace pl::ptrn { void setOffset(u64 offset) override { for (auto &entry : this->m_entries) { - if (entry->getSection() == this->getSection()) { - if (entry->getSection() != ptrn::Pattern::PatternLocalSectionId) - entry->setOffset(entry->getOffset() - this->getOffset() + offset); - else - entry->setOffset(offset); - } + if (entry->getSection() == this->getSection() && entry->getSection() != ptrn::Pattern::PatternLocalSectionId) + entry->setOffset(entry->getOffset() - this->getOffset() + offset); } Pattern::setOffset(offset); diff --git a/lib/include/pl/patterns/pattern_bitfield.hpp b/lib/include/pl/patterns/pattern_bitfield.hpp index 812b56a7..48dcd9b0 100644 --- a/lib/include/pl/patterns/pattern_bitfield.hpp +++ b/lib/include/pl/patterns/pattern_bitfield.hpp @@ -388,12 +388,8 @@ namespace pl::ptrn { void setOffset(u64 offset) override { for (auto &entry : this->m_entries) { - if (entry->getSection() == this->getSection()) { - if (entry->getSection() != ptrn::Pattern::PatternLocalSectionId) - entry->setOffset(entry->getOffset() - this->getOffset() + offset); - else - entry->setOffset(offset); - } + if (entry->getSection() == this->getSection() && entry->getSection() != ptrn::Pattern::PatternLocalSectionId) + entry->setOffset(entry->getOffset() - this->getOffset() + offset); } PatternBitfieldMember::setOffset(offset); @@ -759,12 +755,8 @@ namespace pl::ptrn { void setOffset(u64 offset) override { for (auto &field : this->m_fields) { - if (field->getSection() == this->getSection()) { - if (field->getSection() != ptrn::Pattern::PatternLocalSectionId) - field->setOffset(field->getOffset() - this->getOffset() + offset); - else - field->setOffset(offset); - } + if (field->getSection() == this->getSection() && field->getSection() != ptrn::Pattern::PatternLocalSectionId) + field->setOffset(field->getOffset() - this->getOffset() + offset); } PatternBitfieldMember::setOffset(offset); diff --git a/lib/include/pl/patterns/pattern_struct.hpp b/lib/include/pl/patterns/pattern_struct.hpp index 032dda26..900d517c 100644 --- a/lib/include/pl/patterns/pattern_struct.hpp +++ b/lib/include/pl/patterns/pattern_struct.hpp @@ -72,12 +72,8 @@ namespace pl::ptrn { void setOffset(u64 offset) override { for (auto &member : this->m_members) { - if (member->getSection() == this->getSection()) { - if (member->getSection() != ptrn::Pattern::PatternLocalSectionId) - member->setOffset(member->getOffset() - this->getOffset() + offset); - else - member->setOffset(offset); - } + if (member->getSection() == this->getSection() && member->getSection() != ptrn::Pattern::PatternLocalSectionId) + member->setOffset(member->getOffset() - this->getOffset() + offset); } Pattern::setOffset(offset); diff --git a/lib/include/pl/patterns/pattern_union.hpp b/lib/include/pl/patterns/pattern_union.hpp index a1ddd179..a38be0f7 100644 --- a/lib/include/pl/patterns/pattern_union.hpp +++ b/lib/include/pl/patterns/pattern_union.hpp @@ -71,12 +71,8 @@ namespace pl::ptrn { void setOffset(u64 offset) override { for (auto &member : this->m_members) { - if (member->getSection() == this->getSection()) { - if (member->getSection() != ptrn::Pattern::PatternLocalSectionId) - member->setOffset(member->getOffset() - this->getOffset() + offset); - else - member->setOffset(offset); - } + if (member->getSection() == this->getSection() && member->getSection() != ptrn::Pattern::PatternLocalSectionId) + member->setOffset(member->getOffset() - this->getOffset() + offset); } Pattern::setOffset(offset);