Removed unnecessary cast.

This commit is contained in:
Andrei Errapart 2015-08-24 22:44:56 +02:00 committed by Clifford Wolf
parent 09176bcf3f
commit 522176c946
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ struct BitPatternPool
int width; int width;
struct bits_t { struct bits_t {
std::vector<RTLIL::State> bitdata; std::vector<RTLIL::State> bitdata;
unsigned int cached_hash; mutable unsigned int cached_hash;
bits_t(int width = 0) : bitdata(width), cached_hash(0) { } bits_t(int width = 0) : bitdata(width), cached_hash(0) { }
RTLIL::State &operator[](int index) { RTLIL::State &operator[](int index) {
return bitdata[index]; return bitdata[index];
@ -45,7 +45,7 @@ struct BitPatternPool
} }
unsigned int hash() const { unsigned int hash() const {
if (!cached_hash) if (!cached_hash)
((bits_t*)this)->cached_hash = hash_ops<std::vector<RTLIL::State>>::hash(bitdata); cached_hash = hash_ops<std::vector<RTLIL::State>>::hash(bitdata);
return cached_hash; return cached_hash;
} }
}; };