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

uuid: Add UUID IsIn #214

Closed
wants to merge 1 commit into from
Closed

uuid: Add UUID IsIn #214

wants to merge 1 commit into from

Conversation

deadprogram
Copy link
Member

This PR adds a function IsIn() to UUID which is basically the same as the shortUUID already has.

@ysoldak
Copy link
Contributor

ysoldak commented Jan 2, 2024

Why would one need this? What is the use case?

@ysoldak
Copy link
Contributor

ysoldak commented Jan 2, 2024

slices.Contains() is too heavy for embedded, I suppose?

@ysoldak
Copy link
Contributor

ysoldak commented Jan 2, 2024

I don't feel good about this is general.
Feels unnecessary to extend API with some function that does not really belong to UUID, tbh.

@deadprogram
Copy link
Member Author

I pretty much copied the existing implementation from here https://github.com/tinygo-org/bluetooth/blob/release/uuid_sd.go#L35-L43

@aykevl
Copy link
Member

aykevl commented Jan 2, 2024

I'd be fine with this as an unexported method. I'm not so convinced a method like this needs to be part of the public API: it provides very little value but does add clutter.
Note that the other IsIn is also unexported (because shortUUID is not part of the public API).

@deadprogram
Copy link
Member Author

Note that the other IsIn is also unexported (because shortUUID is not part of the public API).

I did not notice that. I will move the implementation into uuid_ninafw.go to match that.

Now closing.

@deadprogram deadprogram closed this Jan 3, 2024
@deadprogram deadprogram deleted the add-uuid-isin branch January 3, 2024 15:13
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