From 88d04cdf501814fa13543cbb1e3a944cd0dd02c4 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Wed, 16 Feb 2011 20:19:46 +0000 Subject: [PATCH] LUCENE-2905: when no payloads exist, avoid writing wasted pyl pointer deltas in the skipdata git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1071382 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/codecs/sep/SepSkipListReader.java | 4 +++- .../org/apache/lucene/index/codecs/sep/SepSkipListWriter.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java b/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java index 3c8e324aa2d..1803401d6ae 100644 --- a/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java +++ b/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java @@ -197,7 +197,9 @@ class SepSkipListReader extends MultiLevelSkipListReader { docIndex[level].read(skipStream, false); if (!omitTF) { posIndex[level].read(skipStream, false); - payloadPointer[level] += skipStream.readVInt(); + if (currentFieldStoresPayloads) { + payloadPointer[level] += skipStream.readVInt(); + } } return delta; diff --git a/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java b/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java index 866bac6e390..4ec9203af00 100644 --- a/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java +++ b/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java @@ -188,7 +188,9 @@ class SepSkipListWriter extends MultiLevelSkipListWriter { if (!omitTF) { posIndex[level].mark(); posIndex[level].write(skipBuffer, false); - skipBuffer.writeVInt((int) (curPayloadPointer - lastSkipPayloadPointer[level])); + if (curStorePayloads) { + skipBuffer.writeVInt((int) (curPayloadPointer - lastSkipPayloadPointer[level])); + } } lastSkipDoc[level] = curDoc;