Fix array indexing booches.
This commit is contained in:
@@ -621,13 +621,13 @@ public abstract class DepotRepository
|
|||||||
throws DatabaseException
|
throws DatabaseException
|
||||||
{
|
{
|
||||||
// separate the updates into keys and values
|
// separate the updates into keys and values
|
||||||
final ColumnExp[] fields = new ColumnExp[more.length/2+1];
|
final ColumnExp[] fields = new ColumnExp[1+more.length/2];
|
||||||
final SQLExpression[] values = new SQLExpression[fields.length+1];
|
final SQLExpression[] values = new SQLExpression[fields.length];
|
||||||
fields[0] = field;
|
fields[0] = field;
|
||||||
values[0] = makeValue(value);
|
values[0] = makeValue(value);
|
||||||
for (int ii = 0, idx = 0; ii < fields.length; ii++) {
|
for (int ii = 1, idx = 0; ii < fields.length; ii++) {
|
||||||
fields[ii+1] = (ColumnExp)more[idx++];
|
fields[ii] = (ColumnExp)more[idx++];
|
||||||
values[ii+1] = makeValue(more[idx++]);
|
values[ii] = makeValue(more[idx++]);
|
||||||
}
|
}
|
||||||
return updatePartial(type, key, invalidator, fields, values);
|
return updatePartial(type, key, invalidator, fields, values);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user