diff options
author | Marius Kintel <marius@kintel.net> | 2012-03-27 22:05:00 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-03-27 22:05:58 (GMT) |
commit | 327310f190bbd81c7b71b568d5bf72bb900cc9db (patch) | |
tree | 9399bb490ecafe9f0c7fd209c680311d829eb631 /src/context.cc | |
parent | 4394c7a030ce7a08c95bd1af2e8c38ffcf972439 (diff) |
Rewrote the Value class to be based on boost::variant - this should reduce memory footprint and improve performance
Diffstat (limited to 'src/context.cc')
-rw-r--r-- | src/context.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/context.cc b/src/context.cc index f96a45b..2decc48 100644 --- a/src/context.cc +++ b/src/context.cc @@ -196,13 +196,13 @@ void register_builtin(Context &ctx) ctx.set_variable("$fa", Value(12.0)); ctx.set_variable("$t", Value(0.0)); - Value zero3; - zero3.type = Value::VECTOR; - zero3.append(new Value(0.0)); - zero3.append(new Value(0.0)); - zero3.append(new Value(0.0)); - ctx.set_variable("$vpt", zero3); - ctx.set_variable("$vpr", zero3); + Value::VectorType zero3; + zero3.push_back(Value(0.0)); + zero3.push_back(Value(0.0)); + zero3.push_back(Value(0.0)); + Value zero3val(zero3); + ctx.set_variable("$vpt", zero3val); + ctx.set_variable("$vpr", zero3val); ctx.set_constant("PI",Value(M_PI)); } |