http://d.puremagic.com/issues/show_bug.cgi?id=4367



--- Comment #2 from Graham Fawcett <graham.fawc...@gmail.com> 2010-06-22 
08:50:01 PDT ---
Hm, did my patch implement 'back' correctly? It's not clear to me
whether it should be this:

  return input[matches[$-1].startIdx .. matches[$-1].endIdx];

(as in my patch), or this:

  size_t end = length - 1;
  return input[matches[end].startIdx .. matches[end].endIdx];

The question arises from the definition of length():

  @property size_t length()
  {
      foreach (i; 0 .. matches.length)
      {
          if (matches[i].startIdx >= input.length) return i;
      }
      return matches.length;
  }

So should back() use length() as a limit, or should it return the last
element of matches?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to