Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Value::isEqual to check for data equality #2199

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pablode
Copy link
Contributor

@pablode pablode commented Jan 26, 2025

Found the need to compare two mx::ValuePtrs and noticed that there is no straightforward way. Did I overlook something? If not, I'm proposing this helper function.

@ld-kerley
Copy link
Contributor

Seems like a nice addition to the API to me.

@@ -333,6 +333,34 @@ string AggregateValue::getValueString() const
return result;
}

bool AggregateValue::isEqual(ConstValuePtr other) const
{
if (!other->isA<AggregateValue>())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good to me from a high level, and the one issue that I notice is the use of 2-space indentation instead of the 4-space indentation that's standard in our C++ codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants