Skip to content

Commit 41bdf0a

Browse files
committed
remove more dead code
1 parent 2fbf52a commit 41bdf0a

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapperTests.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public SyntheticSourceExample example(int maxValues) {
379379
if (randomBoolean()) {
380380
Value v = generateValue();
381381
if (v.malformedOutput == null) {
382-
return new SyntheticSourceExample(v.input, v.output, roundDocValues(v.output), this::mapping);
382+
return new SyntheticSourceExample(v.input, v.output, this::mapping);
383383
}
384384
return new SyntheticSourceExample(v.input, v.malformedOutput, null, this::mapping);
385385
}
@@ -393,9 +393,7 @@ public SyntheticSourceExample example(int maxValues) {
393393
List<Object> outList = Stream.concat(outputFromDocValues.stream(), malformedOutput).toList();
394394
Object out = outList.size() == 1 ? outList.get(0) : outList;
395395

396-
List<Double> outBlockList = outputFromDocValues.stream().map(this::roundDocValues).sorted().toList();
397-
Object outBlock = outBlockList.size() == 1 ? outBlockList.get(0) : outBlockList;
398-
return new SyntheticSourceExample(in, out, outBlock, this::mapping);
396+
return new SyntheticSourceExample(in, out, this::mapping);
399397
}
400398

401399
private record Value(Object input, Double output, Object malformedOutput) {}
@@ -439,16 +437,6 @@ private double round(double d) {
439437
return decoded;
440438
}
441439

442-
private double roundDocValues(double d) {
443-
// Special case due to rounding, see implementation.
444-
if (Math.abs(d) == Double.MAX_VALUE) {
445-
return d;
446-
}
447-
448-
long encoded = Math.round(d * scalingFactor);
449-
return encoded / scalingFactor;
450-
}
451-
452440
private void mapping(XContentBuilder b) throws IOException {
453441
b.field("type", "scaled_float");
454442
b.field("scaling_factor", scalingFactor);

0 commit comments

Comments
 (0)