aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-03-10 16:14:13 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-03-10 16:14:13 +0000
commit2b3b6c9b3428856b215545efd3abb9b8f42cf8b4 (patch)
treebc0f69b7c07ca451d06dc868326215ab8dffc18a /src/libexpr/nixexpr.cc
parent4ada6db1fc9cee9c0e51fb54af8770dd28243dff (diff)
* In theory, this should reduce the number of ATermMap
re-allocations.
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 6fb72687d..aee57acb1 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -50,9 +50,10 @@ void ATermMap::copy(const ATermMap & map)
{
ATermList keys = map.keys();
- /* !!! adjust allocation for load pct */
+ /* !!! We adjust for the maximum load pct by allocating twice as
+ much. Probably a bit too much. */
maxLoadPct = map.maxLoadPct;
- table = ATtableCreate(ATgetLength(keys), maxLoadPct);
+ table = ATtableCreate(ATgetLength(keys) * 2, maxLoadPct);
if (!table) throw Error("cannot create ATerm table");
add(map, keys);