lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Serebrennikov <dmit...@earthlink.net>
Subject Another minor synchro change: SegmentReader
Date Thu, 11 Oct 2001 17:51:25 GMT
This prevents reading norm factors multiple times on the first access 
for a given field.
Like I said, it's minor...

Index: SegmentReader.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/index/SegmentReader.java,v
retrieving revision 1.2
diff -u -w -r1.2 SegmentReader.java
--- SegmentReader.java  2001/09/27 16:27:01     1.2
+++ SegmentReader.java  2001/10/11 17:43:00
@@ -241,6 +241,7 @@
     Norm norm = (Norm)norms.get(field);
     if (norm == null)
       return null;
+    synchronized(norm) {
     if (norm.bytes == null) {
       byte[] bytes = new byte[maxDoc()];
       norms(field, bytes, 0);
@@ -248,6 +249,7 @@
     }
     return norm.bytes;
   }
+  }


Mime
View raw message