diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-05-24 21:27:29 +0200 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-05-24 22:02:15 +0200 |
commit | dbfd0b61e378dd8c0e0f64205756ed7919de083c (patch) | |
tree | ce180a6b8a392e48bd7d2b51941239b267c35f2c | |
parent | 5488c69d2a92fc05b6d3df99ba80b69d5a1a555c (diff) | |
download | yosys-dbfd0b61e378dd8c0e0f64205756ed7919de083c.tar.gz yosys-dbfd0b61e378dd8c0e0f64205756ed7919de083c.tar.bz2 yosys-dbfd0b61e378dd8c0e0f64205756ed7919de083c.zip |
hashlib: Add a hash for bool.
-rw-r--r-- | kernel/hashlib.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/hashlib.h b/kernel/hashlib.h index a523afadd..42fb8d363 100644 --- a/kernel/hashlib.h +++ b/kernel/hashlib.h @@ -66,6 +66,12 @@ struct hash_int_ops { } }; +template<> struct hash_ops<bool> : hash_int_ops +{ + static inline unsigned int hash(bool a) { + return a ? 1 : 0; + } +}; template<> struct hash_ops<int32_t> : hash_int_ops { static inline unsigned int hash(int32_t a) { |