Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Refactor Brakeman::Differ#second_pass #1406
I had noticed that
Turns out the issue is in
In my case, the output of both
I've redone the algorithm by building a set of fingerprints from both warning lists which I then intersect to remove in bulk from both lists. It should have a better complexity than the previous algorithm.
Though, I left a similar algorithm afterwards for backward compatibility with old warning keys (I'm not sure if it's really needed).
Also, I renamed
The issue only happens if the keys are not converted to back into symbols because the following check will return false:
Which then goes into the old warning key check
Where the warnings are considered equal because every key is nil (because the keys are string and not symbols).
In any case, we can probably repurpose this PR as a performance refactor of the Differ then. What do you think? I've addressed your comment about the loops and removed code about the old warning keys.