mirror of
https://github.com/NixOS/nix
synced 2025-07-04 03:01:47 +02:00
Fix case
This commit is contained in:
parent
e17a619106
commit
7edacb6248
1 changed files with 3 additions and 3 deletions
|
@ -653,17 +653,17 @@ NixInt AttrCursor::getInt()
|
|||
cachedValue = root->db->getAttr(getKey());
|
||||
if (cachedValue && !std::get_if<placeholder_t>(&cachedValue->second)) {
|
||||
if (auto i = std::get_if<int_t>(&cachedValue->second)) {
|
||||
debug("using cached Integer attribute '%s'", getAttrPathStr());
|
||||
debug("using cached integer attribute '%s'", getAttrPathStr());
|
||||
return i->x;
|
||||
} else
|
||||
throw TypeError("'%s' is not an Integer", getAttrPathStr());
|
||||
throw TypeError("'%s' is not an integer", getAttrPathStr());
|
||||
}
|
||||
}
|
||||
|
||||
auto & v = forceValue();
|
||||
|
||||
if (v.type() != nInt)
|
||||
throw TypeError("'%s' is not an Integer", getAttrPathStr());
|
||||
throw TypeError("'%s' is not an integer", getAttrPathStr());
|
||||
|
||||
return v.integer;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue