News for hackers. Stuff that matters.
Re:Patterns.dev by arethuza on Thursday December 11, 2025 @10:05AM (#46232282)
If you already have Sets handy - why not use the Set Intersection? (Assuming the Set implementation has that capability).
Re:Patterns.dev by zelphirkalt on Thursday December 11, 2025 @12:42PM (#46234518)
Putting both contents (lists, arrays, whatever you have) into sets, and then calculating the intersection might be more expensive than building the intersected set right away sourcing both non-set contents, I imagine. Though it would probably be easier to read and understand. But that can be solved by naming of functions that process the 2 non-set things.