Skip to content

Commit

Permalink
Fix a bug in Cursor.setValue() generation, current value is not updat…
Browse files Browse the repository at this point in the history
…ed (#49)
  • Loading branch information
leventov committed Jul 1, 2016
1 parent 17af590 commit 302e6d5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ protected void generateValue() {
protected void generateSetValue() {
ifBlock(INSTANCE.isNotFree(cxt, "curKey"));
checkModCount(this, cxt, false);
INSTANCE.writeValue(this, cxt, "index", unwrapValue("value"));
lines(cxt.valueUnwrappedType() + " unwrappedValue = curValue = " + unwrapValue("value") +
";");
INSTANCE.writeValue(this, cxt, "index", "unwrappedValue");
if (possibleArrayCopyOnRemove(cxt)) {
String tableHaveCopied = INSTANCE.parallelKV(cxt) ? "tab != table" : "vals != values";
ifBlock(tableHaveCopied); {
INSTANCE.writeValue(this, cxt, "table", "values", "index", unwrapValue("value"));
INSTANCE.writeValue(this, cxt, "table", "values", "index", "unwrappedValue");
} blockEnd();
}
endOfModCountCheck(this, cxt);
Expand Down

0 comments on commit 302e6d5

Please sign in to comment.