From 982b03382b7bf26677dd2c0212fc94eb84f33f66 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Sun, 25 Aug 2024 12:31:15 +0200 Subject: [PATCH] (index) Optimize DocumentSpan --- .../nu/marginalia/index/forward/spans/DocumentSpan.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/index/index-forward/java/nu/marginalia/index/forward/spans/DocumentSpan.java b/code/index/index-forward/java/nu/marginalia/index/forward/spans/DocumentSpan.java index 54578114..b66030d2 100644 --- a/code/index/index-forward/java/nu/marginalia/index/forward/spans/DocumentSpan.java +++ b/code/index/index-forward/java/nu/marginalia/index/forward/spans/DocumentSpan.java @@ -7,10 +7,10 @@ import nu.marginalia.sequence.CodedSequence; public class DocumentSpan { /** A list of the interlaced start and end positions of each span in the document of this type */ - private final CodedSequence startsEnds; + private final IntList startsEnds; public DocumentSpan(CodedSequence startsEnds) { - this.startsEnds = startsEnds; + this.startsEnds = startsEnds.values(); } public DocumentSpan() { @@ -160,6 +160,6 @@ public class DocumentSpan { return 0; } - return startsEnds.valueCount() / 2; + return startsEnds.size() / 2; } }