Skip to content
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

Return directly from incompatible branches #9997

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nickdrozd
Copy link
Collaborator

Type of Changes

Type
🔨 Refactoring

Description

There are a few functions the do a multi-way branch on some value. They have if/elif/elif/... structure, but the branches are incompatible. This MR changes them to return directly after a match.

This should improve performance a tiny bit, since fewer branches will be checked.

Also introduces a Scope type for the NamesConsumer.

@nickdrozd nickdrozd added the Skip news 🔇 This change does not require a changelog entry label Oct 1, 2024
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.80%. Comparing base (3097f0b) to head (8bdfaaa).

Files with missing lines Patch % Lines
pylint/checkers/variables.py 96.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9997      +/-   ##
==========================================
- Coverage   95.80%   95.80%   -0.01%     
==========================================
  Files         174      174              
  Lines       18937    18923      -14     
==========================================
- Hits        18143    18129      -14     
  Misses        794      794              
Files with missing lines Coverage Δ
pylint/checkers/variables.py 97.24% <96.00%> (+0.04%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

github-actions bot commented Oct 1, 2024

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 8bdfaaa

@nickdrozd
Copy link
Collaborator Author

One line is uncovered, but it was already uncovered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip news 🔇 This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant