Commit 20c4d4bd authored by Victor Yacovlev's avatar Victor Yacovlev

Improved performance on variable store operation

parent e8ccd254
...@@ -2041,13 +2041,16 @@ void KumirVM::do_store(uint8_t s, uint16_t id) ...@@ -2041,13 +2041,16 @@ void KumirVM::do_store(uint8_t s, uint16_t id)
String svalue; String svalue;
const int lineNo =; const int lineNo =;
Variable & variable = findVariable(s, id); Variable & variable = findVariable(s, id);
const int dim = variable.dimension();
ValueType t = variable.baseType(); ValueType t = variable.baseType();
Variable * reference = variable.reference(); Variable * reference = variable.reference();
int bounds[7]; int bounds[7];
if (dim>0)
value.getBounds(bounds); value.getBounds(bounds);
if (value.isConstant()) if (value.isConstant())
variable.setConstValue(value); variable.setConstValue(value);
else { else {
if (dim>0)
variable.setBounds(bounds); variable.setBounds(bounds);
variable.setValue(value.value()); variable.setValue(value.value());
variable.setDimension(value.dimension()); variable.setDimension(value.dimension());
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment