Commit Graph

2 Commits (98b15d46d9767696f4823272b47d01edb51d3521)

Author SHA1 Message Date
Andrew Dunham 98b15d46d9 util/slicesx: add Deduplicate/DeduplicateFunc
These functions allow deduplicating elements in a slice, either via
direct comparison or via a function that returns a key to be used for
comparison.

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: Ie6a20acf0431247487ac5ead110d56580dacfee4
2023-05-20 19:12:20 -04:00
Andrew Dunham 73fa7dd7af util/slicesx: add package for generic slice functions, use
Now that we're using rand.Shuffle in a few locations, create a generic
shuffle function and use it instead. While we're at it, move the
interleaveSlices function to the same package for use.

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I0b00920e5b3eea846b6cedc30bd34d978a049fd3
2023-03-03 16:25:48 -05:00