Adding optional to differentiate between empty sets and unset attributes

Signed-off-by: Ethan Mahintorabi <[email protected]>
This commit is contained in:
Ethan Mahintorabi
2024-03-10 01:56:33 +00:00
parent 36c1bade14
commit 8aef4d549e
8 changed files with 48 additions and 23 deletions
+5 -2
View File
@@ -275,10 +275,13 @@ ConcreteCell::setAttribute(const std::string &key,
attribute_map_.insert(key, value);
}
std::string
std::optional<std::string>
ConcreteCell::getAttribute(const std::string &key) const
{
return attribute_map_.findKey(key);
if (attribute_map_.hasKey(key)) {
return attribute_map_.findKey(key);
}
return {};
}
ConcretePort *