New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streamline FingerprintPatcher #120
Conversation
a864b9c
to
7ce5b8a
Compare
9ff6c23
to
67ecb24
Compare
I did an additional benchmark. Memory usage is unaffected. Runtime drops from 500ms to 200ms in my worst case test. |
cfe55dc
to
141aa6f
Compare
Removing milestone after discussion with Thiemo. This is a non-critical refactoring. |
It's somewhat unfortunate to have to write custom patching code like this. I can see the benefits, though to me it's unclear if those outweigh the drawbacks. Don't let that stop you though, if you think this is better and worth the time, then go for it. |
Rebased on top of #124. |
* @throws PatcherException | ||
* @return string[] | ||
*/ | ||
private function getPatchedAliases( array $aliases, Diff $patch ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This whole method could be replaced with a ListPatcher
call, but this needs wmde/Diff#65.
This streamlines the implementation and avoids calling the methods
Fingerprint::setLabels
,setDescriptions
andsetAliasGroups
.Missing:
Refactor alias patching the same way.Done.Add tests. Lots and lots of them. All the conflicts are currently not tested!Done.Split code. Bad nesting.Done.Bug: T78298