From 2b3b6c9b3428856b215545efd3abb9b8f42cf8b4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 10 Mar 2006 16:14:13 +0000 Subject: * In theory, this should reduce the number of ATermMap re-allocations. --- src/libexpr/nixexpr.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libexpr/nixexpr.cc') diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index 6fb72687d160..aee57acb116e 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); -- cgit 1.4.1