From 20c4d4bd4be06ff7473c4ac995e85f6006367e50 Mon Sep 17 00:00:00 2001 From: Victor Yacovlev Date: Wed, 30 Jan 2013 17:55:08 +0400 Subject: [PATCH] Improved performance on variable store operation --- src/shared/vm/vm.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shared/vm/vm.hpp b/src/shared/vm/vm.hpp index 2cc34f87..f0b595e2 100644 --- a/src/shared/vm/vm.hpp +++ b/src/shared/vm/vm.hpp @@ -2041,14 +2041,17 @@ void KumirVM::do_store(uint8_t s, uint16_t id) String svalue; const int lineNo = stack_contexts.top().lineNo; Variable & variable = findVariable(s, id); + const int dim = variable.dimension(); ValueType t = variable.baseType(); Variable * reference = variable.reference(); int bounds[7]; - value.getBounds(bounds); + if (dim>0) + value.getBounds(bounds); if (value.isConstant()) variable.setConstValue(value); else { - variable.setBounds(bounds); + if (dim>0) + variable.setBounds(bounds); variable.setValue(value.value()); variable.setDimension(value.dimension()); } -- GitLab