refactor(micro-fix): optimize membership comparisons using 'in' operator#5201
Closed
sahilkhan786000 wants to merge 6 commits intoaden-hive:mainfrom
Closed
Conversation
Simplified the error handling logic by replacing multiple or comparisons with an in set. This makes the code more readable and slightly faster.
Updated the terminal key listener to check for newline characters (\r, \n) using a membership test. This is the preferred Pythonic way to handle multiple character checks.
Optimized the logic that finds edges connected to a specific node. Instead of checking source and target separately, it now uses a single in check for better performance.
Refactored the node removal guard to use an in comparison when checking if an edge is still referencing a node.
PR Closed - Requirements Not MetThis PR has been automatically closed because it doesn't meet the requirements. Missing: No linked issue found. To fix:
Exception: To bypass this requirement, you can:
Micro-fix requirements (must meet ALL):
Why is this required? See #472 for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR optimizes multiple equality comparisons across the core framework and tools by replacing or statements with the more Pythonic in operator using sets. This was identified as a performance and readability improvement (PYL-R1714) via static analysis.
Key Considerations:
Type of Change
Related Issues
N/A (Submitted as a collection of micro-fixes for codebase optimization).
Fixes #(issue number)
Changes Made
Testing
Describe the tests you ran to verify your changes:
Checklist