OSDN Git Service

nir: correct use of identity check in python
authorDylan Baker <dylan@pnwbakers.com>
Fri, 25 Oct 2019 20:48:38 +0000 (13:48 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Mon, 4 Nov 2019 16:06:39 +0000 (16:06 +0000)
commit717606f9f32af6540b68336e676fca9dd16f282a
treedda46fe7ac086d3272d573cf766501da1a2cb317
parent28440820eff55d412fbce3243c24bc9f58c3b8e6
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: 96c4b135e34d0804e41bfbc28fc1b5050c49d71e
       ("nir/algebraic: Don't put quotes around floating point literals")
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/nir/nir_algebraic.py