lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <>
Subject Re: Question about string retrieval with FieldCache in trunk
Date Wed, 18 Aug 2010 16:03:49 GMT
On Wed, Aug 18, 2010 at 11:28 AM,  <> wrote:
> If you are correct, the comment is certainly incorrect, since it implies that the SAME
BytesRef is returned as you pass in.

Yes, that's correct.  BytesRef is mutable.  You pass in an instance,
and the value is set and the same BytesRef is normally returned to
you.  I guess the fact that it's returned at all is to allow a
flexible implementation to possibly return a BytesRef from somewhere

  BytesRef reuse = new BytesRef();
  for (;;) {
    BytesRef val = docTerms.getTerm(id, reuse);
    // use val, but make a copy

I think Mike changed the implementation in the past.  We should check
if a BytesRef return value is really needed.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message