From e828a57eba62ff2469c894d3e50ecc58f36d810b Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 13 Aug 2013 16:59:48 +0800 Subject: vector gc --- builtin.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'builtin.cpp') diff --git a/builtin.cpp b/builtin.cpp index f1e4c19..6eb0c0f 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -1447,9 +1447,7 @@ BUILTIN_PROC_DEF(make_vector) { else throw TokenError(name, RUN_ERR_WRONG_NUM_OF_ARGS); - VecObj *res = new VecObj(); - res->resize(size_t(len)); - res->fill(fill); + VecObj *res = new VecObj(size_t(len), fill); return res; } @@ -1497,7 +1495,7 @@ BUILTIN_PROC_DEF(vector_ref) { ssize_t k = static_cast(args->car)->get_i(); if (k < 0) throw TokenError("a non-negative integer", RUN_ERR_WRONG_TYPE); - return vect->get_obj(k); + return vect->get(k); } BUILTIN_PROC_DEF(vector_length) { -- cgit v1.2.3