If we remove operands after building a graph, existing method doesn't
work. Moreover, complexity of std::unordered_map::find is O(1), so we
don't loose much in time
Signed-off-by: Poshshoev Dilshodzhon <d.poshshoev@samsung.com>
bool Operands::exist(const OperandIndex &OperandIndex) const
{
- return OperandIndex.value() < _objects.size();
+ auto it = _objects.find(OperandIndex);
+ return it != _objects.end();
}
void Operands::iterate(const std::function<void(const OperandIndex &, const Operand &)> &fn) const