Skip to content

Commit 2546eee

Browse files
committed
set comparison to enum value
1 parent f36d7dc commit 2546eee

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

slither/core/variables/local_variable.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ def is_storage(self) -> bool:
6161
# pylint: disable=import-outside-toplevel
6262
from slither.core.solidity_types.array_type import ArrayType
6363

64-
if self.location == VariableLocation.MEMORY:
64+
if self.location == VariableLocation.MEMORY.value:
6565
return False
66-
if self.location == VariableLocation.CALLDATA:
66+
if self.location == VariableLocation.CALLDATA.value:
6767
return False
6868
# Use by slithIR SSA
69-
if self.location == VariableLocation.REFERENCE_TO_STORAGE:
69+
if self.location == VariableLocation.REFERENCE_TO_STORAGE.value:
7070
return False
71-
if self.location == VariableLocation.STORAGE:
71+
if self.location == VariableLocation.STORAGE.value:
7272
return True
7373

7474
if isinstance(self.type, (ArrayType, MappingType)):

slither/core/variables/state_variable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ def is_stored(self) -> bool:
4444
return (
4545
not self._is_constant
4646
and not self._is_immutable
47-
and not self._location == VariableLocation.TRANSIENT
47+
and not self._location == VariableLocation.TRANSIENT.value
4848
)
4949

5050
@property
5151
def is_transient(self) -> bool:
5252
"""
5353
Checks if the state variable is transient. A transient variable can not be constant or immutable.
5454
"""
55-
return self._location == VariableLocation.TRANSIENT
55+
return self._location == VariableLocation.TRANSIENT.value
5656

5757
# endregion
5858
###################################################################################

0 commit comments

Comments
 (0)