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 null UUID definition to use for comparing #128

Closed
wants to merge 1 commit into from

Conversation

martincapello
Copy link
Member

This PR just defines a "null" UUID constant by introducing a static const member to the Uuid class.

@aseprite-bot
Copy link
Collaborator

clang-tidy review says "All clean, LGTM! 👍"

@martincapello
Copy link
Member Author

This is not needed anymore actually...so feel free to do whatever you want with this.

@dacap
Copy link
Member

dacap commented Jan 22, 2025

I'll close this as it's not required and the expected behavior is that just creating a new Uuid() with the default contructor will create an empty Uuid():

laf/base/uuid_tests.cpp

Lines 13 to 19 in 412139c

TEST(Uuid, Empty)
{
Uuid uuid;
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(0, uuid[i]);
}
}

Generally uuid == Uuid() should be enough to check if an UUID is empty, but we could add a new member function bool empty() const if needed.

@dacap dacap closed this Jan 22, 2025
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