I'm working on an Angular2 application and I think one very small, specific function (list filtering) needs improvement and I would welcome reviews. Essentially I iterate more times than I think is necessary (meaning it could be done more efficiently -- which is the reason I am seeking review).
My scenario amounts to: I do this thing in 4 passes, is it possible to do it in a single pass through a method I am not familiar with?
Given the way CR.se appears to work, I'm wary of posting merely the function body some sample data because the function makes references to class members. I foresee "but where's the rest of your class?", which is frankly irrelevant to the question.
I could trivially re-implement a semantically-identical function which is not my original code. I can trivially create an MCVE that is runnable within an in-page snippet which conveys my problem.
But that raises the question, does that make it a "Let's suppose" question? I think it might.
If so, should avoid CR.se and just post it to SO?
EDIT: To close the loop, this is the question I eventually asked: Create several homogeneous arrays from a larger heterogenous array efficiently