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

Remove the unused local variable 'hint_resolutions' #6022

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KeyLee123
Copy link

Local variable 'hint_resolutions' value is not used, and In the following if statement, this variable will be reassigned.

Local variable 'hint_resolutions' value is not used, and In the following if statement, this variable will be reassigned.

Signed-off-by: lixu <[email protected]>
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @KeyLee123, good catch, thank you very much. Since you are already doing this change, I think we can remove the hint_resolutions variable completely. What do you think?

@@ -261,12 +261,10 @@ def _extend_directory(path):

 def resolve(references, hint=None, ignore_missing=True, config=None):
     resolutions = []
-    hint_resolutions = []
     hint_references = {}

     if hint:
-        hint_resolutions = hint.get_resolutions()
-        hint_references = {r.reference: r for r in hint_resolutions}
+        hint_references = {r.reference: r for r in hint.get_resolutions()}

     if not references and hint_references:
         references = list(hint_references.keys())


@KeyLee123
Copy link
Author

Hi @richtja, I completely agree with you, hint_resolutions variable can be removed completely.

@richtja
Copy link
Contributor

richtja commented Sep 24, 2024

Hi @KeyLee123, gentle ping here. Do you plan to continue with this by completely removing the hint_resolutions variable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review Requested
Development

Successfully merging this pull request may close these issues.

2 participants