lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: scorer.skipTo() contr
Date Wed, 06 Jun 2007 23:56:22 GMT

: But I think it should be the desired behavior for skipTo() to not skip
: at all
: if curDoc==target already? Which means we should clearify the javadocs.

i'm not certain about that ... in theory (given the way the
javadocs are currently written) shouldn't s.skipTo(0) always be
functionally equivilent to s.next() ?

I'm pbasingthis on the assumption that there must be some reason why the
"behaves as" clause was written as...

   *   boolean skipTo(int target) {
   *     do {
   *       if (!next())
   * 	     return false;
   *     } while (target > doc());
   *     return true;
   *   }

and not...

  boolean skipTo(int target) {
    while (target > doc()) {
      if (!next()) return false;
    }
    return true;
  }

...which is what you are describing.



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message