-
Notifications
You must be signed in to change notification settings - Fork 232
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
Simplify failure deduplication in looponfail #544
base: master
Are you sure you want to change the base?
Conversation
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.
i finally got to this
it looks good, it took a bit to follow back how it goes into the remotes trails variable
please rebase to master and add a changelog entry (or let me know if i may do that for you)
nice find!
e8f7d61
to
f51cd65
Compare
Sorry for the late reply, I somehow missed the review. I rebased onto master, let's see what CI thinks. |
if failure not in uniq_failures: | ||
uniq_failures.append(failure) | ||
self.failures = uniq_failures | ||
self.failures = list(set(failures)) |
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.
does this preserve order?
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.
It does not, I can change it to
self.failures = list(set(failures)) | |
self.failures = list(dict.fromkeys(failures)) |
which will preserve the order if required.
This PR simplifies deduplication of failures in
looponfail
usingset
instead of iterating over all failures. This should simplify the code and in general might be a bit faster as well.