Skip to content

Commit f935144

Browse files
committed
removed null checking for ffvslice for now because it's extra cruft; we can re-introduce it in the future if desired / needed
1 parent 93ca452 commit f935144

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

server/src/main/java/org/elasticsearch/index/codec/vectors/cluster/FloatVectorValuesSlice.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,15 @@ class FloatVectorValuesSlice extends FloatVectorValues {
1919
private final int[] slice;
2020

2121
FloatVectorValuesSlice(FloatVectorValues allValues, int[] slice) {
22-
assert slice == null || slice.length <= allValues.size();
22+
assert slice != null;
23+
assert slice.length <= allValues.size();
2324
this.allValues = allValues;
24-
if (slice != null && slice.length == allValues.size()) {
25-
this.slice = null;
26-
} else {
27-
this.slice = slice;
28-
}
25+
this.slice = slice;
2926
}
3027

3128
@Override
3229
public float[] vectorValue(int ord) throws IOException {
33-
if (this.slice == null) {
34-
return this.allValues.vectorValue(ord);
35-
} else {
36-
return this.allValues.vectorValue(this.slice[ord]);
37-
}
30+
return this.allValues.vectorValue(this.slice[ord]);
3831
}
3932

4033
@Override
@@ -44,20 +37,12 @@ public int dimension() {
4437

4538
@Override
4639
public int size() {
47-
if (slice == null) {
48-
return allValues.size();
49-
} else {
50-
return slice.length;
51-
}
40+
return slice.length;
5241
}
5342

5443
@Override
5544
public int ordToDoc(int ord) {
56-
if (this.slice == null) {
57-
return ord;
58-
} else {
59-
return this.slice[ord];
60-
}
45+
return this.slice[ord];
6146
}
6247

6348
@Override

0 commit comments

Comments
 (0)