Skip to content

Add setof helper package#391

Merged
klauspost merged 1 commit intotinylib:masterfrom
klauspost:setof
May 13, 2025
Merged

Add setof helper package#391
klauspost merged 1 commit intotinylib:masterfrom
klauspost:setof

Conversation

@klauspost
Copy link
Collaborator

Package setof allows serializing sets map[T]struct{} as arrays - as compared to a map, which only allows for string keys.

Nil maps are preserved as a nil value on stream.

A deterministic (sorted) version is available, with slightly lower performance.

Kind of marginal, but keeping it as a separate package makes it so it doesn't pollute the main namespace.

Package setof allows serializing sets map[T]struct{} as arrays.

Nil maps are preserved as a nil value on stream.

A deterministic (sorted) version is available, with slightly lower performance.
@klauspost klauspost requested a review from philhofer April 21, 2025 16:49
@klauspost klauspost merged commit 12160bd into tinylib:master May 13, 2025
4 checks passed
@klauspost klauspost deleted the setof branch May 13, 2025 12:23
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.

1 participant