libs/base/src/eu/base/hash.set.cc
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "eu/base/hash.set.h" | ||
| 2 | |||
| 3 | namespace eu | ||
| 4 | { | ||
| 5 | ✗ | void HshSt::add(const Hsh& h) | |
| 6 | { | ||
| 7 | ✗ | data.emplace(h); | |
| 8 | ✗ | } | |
| 9 | |||
| 10 | ✗ | HshSt HshSt::combine(const Hsh& h) const | |
| 11 | { | ||
| 12 | ✗ | auto clone = data; | |
| 13 | ✗ | clone.emplace(h); | |
| 14 | ✗ | return HshSt{.data = clone, .primary = h }; | |
| 15 | ✗ | } | |
| 16 | |||
| 17 | ✗ | bool HshSt::contains(const Hsh& h) const | |
| 18 | { | ||
| 19 | ✗ | const auto found = data.find(h); | |
| 20 | ✗ | return found != data.end(); | |
| 21 | } | ||
| 22 | |||
| 23 | ✗ | bool HshSt::is(const HshSt& h) const | |
| 24 | { | ||
| 25 | ✗ | return contains(h.primary); | |
| 26 | } | ||
| 27 | |||
| 28 | } | ||
| 29 |