Search backend: eliminate slice mutation
Created by: camdencheek
findPatternRevs
currently mutates its input slice, includePatterns
,
seemingly to avoid the extra allocation from creating a new slice.
However, at some point, we started copying the slice on the input side
to avoid race conditions, defeating the purpose of mutating the slice
and making the code more difficult to follow. This just modifies
findPatternRevs
so that it no longer mutates the input slice and
returns the a new slice with the modified include patterns.
Test plan
Semantics-preserving. Depending on existing tests.