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

Closed
wants to merge 3 commits into from

Conversation

nickdrozd
Copy link
Contributor

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).
Report is 68 commits behind head on main.

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
Contributor Author

One line is uncovered, but it was already uncovered.

@nickdrozd nickdrozd closed this Oct 7, 2024
@nickdrozd nickdrozd deleted the branches branch October 7, 2024 14:58
@DanielNoord
Copy link
Collaborator

This seems like a useful change. Any reason for closing it?

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.

2 participants