Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 97991 invoked from network); 18 Aug 2010 16:04:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Aug 2010 16:04:17 -0000 Received: (qmail 91513 invoked by uid 500); 18 Aug 2010 16:04:15 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 91462 invoked by uid 500); 18 Aug 2010 16:04:15 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 91455 invoked by uid 99); 18 Aug 2010 16:04:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Aug 2010 16:04:15 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yseeley@gmail.com designates 209.85.215.48 as permitted sender) Received: from [209.85.215.48] (HELO mail-ew0-f48.google.com) (209.85.215.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Aug 2010 16:04:10 +0000 Received: by ewy10 with SMTP id 10so612187ewy.35 for ; Wed, 18 Aug 2010 09:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=NEK1ywKFL4iawDZr8ALUk1ROJVs1PHm/CwU2rI8s9Ms=; b=KAEuoxU272CtTmPPb0wrMMwlHNG5p2Pqsz99IzhGe5Kfkak0ElAEYd4RRXfTWaCHUz tPhriihnpt6O9MiKt+Q2Jjg61uP8sFtcgIWP/TF84pKd1oKrlU/wiGl1EPANxEN9QAM1 669HXU+a5Ls9Qv0SuHeYbi1hNC+gjULaSRKXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=mYUrXOaTnmPSGBu3HwJ0lbF3RdZ/1Rwg/h8fyiMG1uZK3Rq7nWaMAEESvMLhUEwXzd rrTMrSgp/FrhxazhGCp7DpDLB86LvUkGllOJo8EGu1wcFczOGdH8dFra3aoEBkem/Pgt 9cFmhvA2O7JrAgmwzTTuAxYepe9sleAxLk9u0= MIME-Version: 1.0 Received: by 10.216.54.16 with SMTP id h16mr7231598wec.6.1282147429213; Wed, 18 Aug 2010 09:03:49 -0700 (PDT) Sender: yseeley@gmail.com Reply-To: yonik@lucidimagination.com Received: by 10.216.6.138 with HTTP; Wed, 18 Aug 2010 09:03:49 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 Aug 2010 12:03:49 -0400 X-Google-Sender-Auth: XcAYs9tEfBL3KiPzyN-2fOOgsQY Message-ID: Subject: Re: Question about string retrieval with FieldCache in trunk From: Yonik Seeley To: dev@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 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 else. So: 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. -Yonik http://www.lucidimagination.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org