Skip to content

Commit

Permalink
fix CopyHooksCallback to return always true
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Hanca <[email protected]>
  • Loading branch information
jhanca-robotecai committed Dec 13, 2023
1 parent 2ba322b commit b3d22c1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ namespace ROS2
//! @param outputBuffer output buffer where hooks are copied
//! @param classData serialization context in which queried attribute might exist.
//! @param attributeName name of the attribute used to store hooks.
//! @return true if not found; false if found (stop iterating)
//! @return this method returns always true, to enforce EnumerateAll method to iterate over all classes
template<typename T>
bool CopyHooksCallback(T& outputBuffer, const AZ::SerializeContext::ClassData* classData, const AZStd::string& attributeName)
{
auto* attribute = AZ::FindAttribute(AZ::Crc32(attributeName.c_str()), classData->m_attributes);
if (attribute == nullptr)
{
return true; // attribute not found; keep iterating
return true; // attribute not found, keep iterating
}

AZ::AttributeReader reader(nullptr, attribute);
Expand All @@ -69,7 +69,7 @@ namespace ROS2
outputBuffer.insert(outputBuffer.end(), readData.begin(), readData.end());
}

return false; // attribute found, hooks copied; stop iterating
return true; // attribute found, keep iterating to find hooks declared in other classes
}

// Timeout for loop waiting for assets to be built
Expand Down

0 comments on commit b3d22c1

Please sign in to comment.