mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
* Use a map to lookup primops.
* Various performance improvements in the evaluator. * Do not link against unused (and missing!) libraries (-lsglr, etc.).
This commit is contained in:
parent
c4f7ae4aa5
commit
9b44480612
12 changed files with 127 additions and 75 deletions
|
@ -20,8 +20,7 @@ ATermMap::ATermMap(const ATermMap & map)
|
|||
table = ATtableCreate(ATgetLength(keys), maxLoadPct);
|
||||
if (!table) throw Error("cannot create ATerm table");
|
||||
|
||||
for (ATermIterator i(keys); i; ++i)
|
||||
set(*i, map.get(*i));
|
||||
add(map, keys);
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,6 +74,26 @@ ATermList ATermMap::keys() const
|
|||
}
|
||||
|
||||
|
||||
void ATermMap::add(const ATermMap & map)
|
||||
{
|
||||
ATermList keys = map.keys();
|
||||
add(map, keys);
|
||||
}
|
||||
|
||||
|
||||
void ATermMap::add(const ATermMap & map, ATermList & keys)
|
||||
{
|
||||
for (ATermIterator i(keys); i; ++i)
|
||||
set(*i, map.get(*i));
|
||||
}
|
||||
|
||||
|
||||
void ATermMap::reset()
|
||||
{
|
||||
ATtableReset(table);
|
||||
}
|
||||
|
||||
|
||||
ATerm string2ATerm(const string & s)
|
||||
{
|
||||
return (ATerm) ATmakeAppl0(ATmakeAFun((char *) s.c_str(), 0, ATtrue));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue