mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-05 22:00:11 +01:00
nir: correct use of identity check in python
Python has the identity operator `is`, and the equality operator `==`.
Using `is` with strings sometimes works in CPython due to optimizations
(they have some kind of cache), but it may not always work.
Fixes: 96c4b135e3
("nir/algebraic: Don't put quotes around floating point literals")
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
28440820ef
commit
717606f9f3
1 changed files with 2 additions and 2 deletions
|
|
@ -301,8 +301,8 @@ class Variable(Value):
|
|||
# constant. If we want to support names that have numeric or
|
||||
# punctuation characters, we can me the first assertion more flexible.
|
||||
assert self.var_name.isalpha()
|
||||
assert self.var_name is not 'True'
|
||||
assert self.var_name is not 'False'
|
||||
assert self.var_name != 'True'
|
||||
assert self.var_name != 'False'
|
||||
|
||||
self.is_constant = m.group('const') is not None
|
||||
self.cond = m.group('cond')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue