Optimization of string and vector with references and less functional code, bugfix of closing over references

This commit is contained in:
Nathan Braswell
2015-08-04 14:57:56 -04:00
parent d59cb5e252
commit e1dbe08c0a
8 changed files with 67 additions and 42 deletions

View File

@@ -24,11 +24,19 @@ obj vector<T> (Object) {
data = new<T>(8);
return this;
}
fun construct(ammt: int): *vector<T> {
size = 0;
available = ammt;
data = new<T>(ammt);
return this;
}
fun copy_construct(old: *vector<T>): void {
construct()
construct(old->size)
size = old->size
for (var i = 0; i < old->size; i++;)
addEnd(old->get(i))
maybe_copy_construct(&data[i], &old->data[i]);
//addEnd(old->get(i))
}
fun destruct(): void {