Set capacity of hash maps.

This commit is contained in:
Stephen Chung
2020-11-15 12:07:35 +08:00
parent a63f14b59c
commit bde8917ed4
7 changed files with 100 additions and 72 deletions

View File

@@ -23,8 +23,7 @@ impl Engine {
/// In other words, loaded packages are searched in reverse order.
#[inline(always)]
pub fn load_package(&mut self, package: impl Into<PackageLibrary>) -> &mut Self {
// Push the package to the top - packages are searched in reverse order
self.packages.push(package.into());
self.packages.add(package.into());
self
}
/// Control whether and how the `Engine` will optimize an AST after compilation.