mirror of
https://git.suyu.dev/suyu/sirit.git
synced 2026-01-03 13:15:36 +01:00
operand: Implement operand hashing and use hashed set for declarations
Instead of manually searching each element in the declarations vector, use an unordered_set to emplace new declarations avoiding repetition.
This commit is contained in:
parent
f7c4b07a7e
commit
1e665afa36
10 changed files with 66 additions and 13 deletions
|
|
@ -35,4 +35,8 @@ bool LiteralNumber::operator==(const Operand& other) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
std::size_t LiteralNumber::Hash() const {
|
||||
return static_cast<std::size_t>(raw) ^ Operand::Hash();
|
||||
}
|
||||
|
||||
} // namespace Sirit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue