- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.4k
perf: use list join instead of string concatenation in loop #3829
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|  | @@ -98,9 +98,15 @@ def _get_function_names( | |||||||
| ) | ||||||||
| if not resolved_function_name: | ||||||||
| continue | ||||||||
| self.function_names.setdefault(api_name, "") | ||||||||
| self.function_names[api_name] += str(resolved_function_name) | ||||||||
| return self.function_names | ||||||||
| # OLD APPROACH: String concatenation in loop | ||||||||
| # self.function_names.setdefault(api_name, "") | ||||||||
| # self.function_names[api_name] += str(resolved_function_name) | ||||||||
| # NEW APPROACH: Collect in list | ||||||||
| if api_name not in self.function_names: | ||||||||
| self.function_names[api_name]=[] | ||||||||
|          | ||||||||
| if api_name not in self.function_names: | |
| self.function_names[api_name]=[] | |
| self.function_names.setdefault(api_name, []) | 
        
          
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is also probably unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okayy
        
          
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same suggestion on commenting the old approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the comment with the old approach.