[Development] QString behavior change

Thiago Macieira thiago.macieira at intel.com
Fri Jul 31 18:01:38 CEST 2015


On Friday 31 July 2015 10:30:33 Giuseppe D'Angelo wrote:
> On Fri, Jul 31, 2015 at 10:25 AM, Thiago Macieira
> 
> <thiago.macieira at intel.com> wrote:
> > In this particular case, it was reasoned that the API was inconsistent and
> > broken. So the behaviour was changed intentionally.
> 
> TBH, it looks like it's still inconsistent (an empty string keeps its
> storage allocated, a string made of spaces doesn't).

Right, they are these two cases of trimmed_helper:

        if (begin == str.cbegin() && end == str.cend())
            return str;
        if (begin == end)
            return StringType();

The consistency of nullness is secondary to performance in this code section. 
I'm not going to add a test before those two.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list