added getOrDefault; bootstrapping works again

This commit is contained in:
Araq 2015-10-13 03:03:05 +02:00
commit 2fda95a4d6
9 changed files with 52 additions and 40 deletions

View file

@ -48,7 +48,7 @@ proc addPackage(packages: StringTableRef, p: string) =
let name = p.substr(0, x-1)
if x < p.len:
let version = p.substr(x+1)
if packages[name] <. version:
if packages.getOrDefault(name) <. version:
packages[name] = version
else:
packages[name] = latest