mirror of
https://github.com/NixOS/nix
synced 2025-07-01 12:37:59 +02:00
Get rid of most .at
calls (#6393)
Use one of `get` or `getOr` instead which will either return a null-pointer (with a nicer error message) or a default value when the key is missing.
This commit is contained in:
parent
9489b4b7ef
commit
1385b20078
22 changed files with 231 additions and 118 deletions
|
@ -176,7 +176,7 @@ int main(int argc, char ** argv)
|
|||
impurePaths.insert(argv[2]);
|
||||
else {
|
||||
auto drv = store->derivationFromPath(store->parseStorePath(argv[1]));
|
||||
impurePaths = tokenizeString<StringSet>(get(drv.env, "__impureHostDeps").value_or(""));
|
||||
impurePaths = tokenizeString<StringSet>(getOr(drv.env, "__impureHostDeps", ""));
|
||||
impurePaths.insert("/usr/lib/libSystem.dylib");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue