Re: make OUString::copy() clip

2012-08-02 Thread Stephan Bergmann
On 08/02/2012 02:39 PM, Noel Grandin wrote: On 2012-08-02 14:35, Stephan Bergmann wrote: No "defensive programming," please. If we consider a given (beginIndex, count) arguments a violation of copy's precondition, then fail on it, as fast as possible (via assert -> abort in a non-NDEBUG build,

Re: make OUString::copy() clip

2012-08-02 Thread Noel Grandin
On 2012-08-02 14:35, Stephan Bergmann wrote: No "defensive programming," please. If we consider a given (beginIndex, count) arguments a violation of copy's precondition, then fail on it, as fast as possible (via assert -> abort in a non-NDEBUG build, via undefined behavior (-> hopefully cra

Re: make OUString::copy() clip

2012-08-02 Thread Stephan Bergmann
On 08/02/2012 02:16 PM, Eike Rathke wrote: On Wednesday, 2012-08-01 22:02:50 +0200, Michael Stahl wrote: On 01/08/12 19:05, Eike Rathke wrote: On Wednesday, 2012-08-01 18:17:12 +0200, Stephan Bergmann wrote: make rtl::OUString::copy(beginIndex, count) clip to [0..length)? yeah, why not (then

Re: make OUString::copy() clip

2012-08-02 Thread Eike Rathke
Hi Michael, On Wednesday, 2012-08-01 22:02:50 +0200, Michael Stahl wrote: > On 01/08/12 19:05, Eike Rathke wrote: > > On Wednesday, 2012-08-01 18:17:12 +0200, Stephan Bergmann wrote: > > > >> make rtl::OUString::copy(beginIndex, count) clip to [0..length)? > >> yeah, why not (then again, -1's s

Re: make OUString::copy() clip

2012-08-01 Thread Michael Stahl
On 01/08/12 19:05, Eike Rathke wrote: > Hi Stephan, > > On Wednesday, 2012-08-01 18:17:12 +0200, Stephan Bergmann wrote: > >> make rtl::OUString::copy(beginIndex, count) clip to [0..length)? >> yeah, why not (then again, -1's sentinel nature, cf. indexOf, might >> mean that silent clipping of be