Skip to content

Commit

Permalink
Fix return value for increment method (elastic#75053)
Browse files Browse the repository at this point in the history
Fixes CI failures for elastic#75053
  • Loading branch information
ywelsch committed Oct 15, 2021
1 parent 57e503c commit 3e31185
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ public int set(long index, int value) {
@Override
public int increment(long index, int inc) {
assert index >= 0 && index < size();
final int ret = (int) VH_PLATFORM_NATIVE_INT.get(array, (int) index << 2);
VH_PLATFORM_NATIVE_INT.set(array, (int) index << 2, ret + inc);
final int ret = (int) VH_PLATFORM_NATIVE_INT.get(array, (int) index << 2) + inc;
VH_PLATFORM_NATIVE_INT.set(array, (int) index << 2, ret);
return ret;
}

Expand Down Expand Up @@ -235,8 +235,8 @@ public long set(long index, long value) {
@Override
public long increment(long index, long inc) {
assert index >= 0 && index < size();
final long ret = (long) VH_PLATFORM_NATIVE_LONG.get(array, (int) index << 3);
VH_PLATFORM_NATIVE_LONG.set(array, (int) index << 3, ret + inc);
final long ret = (long) VH_PLATFORM_NATIVE_LONG.get(array, (int) index << 3) + inc;
VH_PLATFORM_NATIVE_LONG.set(array, (int) index << 3, ret);
return ret;
}

Expand Down Expand Up @@ -286,8 +286,8 @@ public double set(long index, double value) {
@Override
public double increment(long index, double inc) {
assert index >= 0 && index < size();
final double ret = (double) VH_PLATFORM_NATIVE_DOUBLE.get(array, (int) index << 3);
VH_PLATFORM_NATIVE_DOUBLE.set(array, (int) index << 3, ret + inc);
final double ret = (double) VH_PLATFORM_NATIVE_DOUBLE.get(array, (int) index << 3) + inc;
VH_PLATFORM_NATIVE_DOUBLE.set(array, (int) index << 3, ret);
return ret;
}

Expand Down Expand Up @@ -337,8 +337,8 @@ public float set(long index, float value) {
@Override
public float increment(long index, float inc) {
assert index >= 0 && index < size();
final float ret = (float) VH_PLATFORM_NATIVE_FLOAT.get(array, (int) index << 2);
VH_PLATFORM_NATIVE_FLOAT.set(array, (int) index << 2, ret + inc);
final float ret = (float) VH_PLATFORM_NATIVE_FLOAT.get(array, (int) index << 2) + inc;
VH_PLATFORM_NATIVE_FLOAT.set(array, (int) index << 2, ret);
return ret;
}

Expand Down

0 comments on commit 3e31185

Please sign in to comment.