-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] Fix uniqueing compilation commands
We are storing unique compilation actions in a map which uses the overriden `__hash__` and `__eq__` methods on the `BuildAction` class. For this we used the following logic: ```py if action.__hash__ not in uniqued_build_actions: uniqued_build_actions[action.__hash__] = action ``` In this case we didn't called the function but we checked whether the function is in the map. Before `Python 3.9` this solution somehow worked but in later Python versions it will not unique compilation actions properly. To solve this problem we will use the following logic: ```py if action not in uniqued_build_actions: uniqued_build_actions[action] = action ``` Under the hood the Python interpreter will call the overriden dunder functions.
- Loading branch information
1 parent
5adc515
commit b15592a
Showing
5 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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