Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

New checker unnecessary-list-index-lookup #4525

Closed
yushao2 opened this issue May 31, 2021 · 1 comment · Fixed by #5834
Closed

New checker unnecessary-list-index-lookup #4525

yushao2 opened this issue May 31, 2021 · 1 comment · Fixed by #5834
Labels
Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors
Milestone

Comments

@yushao2
Copy link
Contributor

yushao2 commented May 31, 2021

As discussed originally in PR #4508

for i, _ in enumerate(self.options_providers):
    if provider.priority > self.options_providers[i].priority: #  the index lookup here is unnecessary
        self.options_providers.insert(i, provider)
        break
@Pierre-Sassoulas Pierre-Sassoulas added the Enhancement ✨ Improvement to a component label May 31, 2021
@Pierre-Sassoulas
Copy link
Member

Thank you for the follow up !

@yushao2 yushao2 added the Good first issue Friendly and approachable by new contributors label Jun 30, 2021
timmartin added a commit to timmartin/pylint that referenced this issue Feb 23, 2022
timmartin added a commit to timmartin/pylint that referenced this issue Feb 23, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.14.0 milestone Feb 25, 2022
timmartin added a commit to timmartin/pylint that referenced this issue Feb 27, 2022
timmartin added a commit to timmartin/pylint that referenced this issue Feb 27, 2022
timmartin added a commit to timmartin/pylint that referenced this issue Mar 1, 2022
timmartin added a commit to timmartin/pylint that referenced this issue Mar 2, 2022
…4525)

Refactoring to prevent warnings being issued on these lines from a new
checker.
timmartin added a commit to timmartin/pylint that referenced this issue Mar 3, 2022
timmartin added a commit to timmartin/pylint that referenced this issue Mar 4, 2022
timmartin added a commit to timmartin/pylint that referenced this issue Mar 25, 2022
timmartin added a commit to timmartin/pylint that referenced this issue Mar 25, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants