From 7f95cd383e1efd4cec3d818f71c64f143907f0b0 Mon Sep 17 00:00:00 2001 From: expani Date: Tue, 22 Oct 2024 13:47:30 +0530 Subject: [PATCH] Excluding lines with comments --- .../lucene/benchmark/jmh/DocIdEncodingBenchmark.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/DocIdEncodingBenchmark.java b/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/DocIdEncodingBenchmark.java index 955ff01b91c..9f618be1569 100644 --- a/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/DocIdEncodingBenchmark.java +++ b/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/DocIdEncodingBenchmark.java @@ -304,8 +304,7 @@ public class DocIdEncodingBenchmark { out.writeLong(packedLong); } for (; i < count; i++) { - // out.writeInt(docIds[i]); - out.writeLong(docIds[i]); + out.writeInt(docIds[i]); } } @@ -319,8 +318,7 @@ public class DocIdEncodingBenchmark { docIDs[i + 2] = (int) (packedLong & BPV_21_MASK); } for (; i < count; i++) { - // docIDs[i] = in.readInt(); - docIDs[i] = (int) in.readLong(); + docIDs[i] = in.readInt(); } } } @@ -472,7 +470,8 @@ public class DocIdEncodingBenchmark { try (Stream lines = Files.lines(Path.of((String) args[0]))) { return lines .parallel() - .filter(x -> !x.trim().startsWith("#")) + .map(String::trim) + .filter(x -> !(x.startsWith("#") || x.isEmpty())) // Comments can start with a # .map( x -> Arrays.stream(x.split(","))