[Development] QOptional

Thiago Macieira thiago.macieira at intel.com
Thu Aug 21 16:26:52 CEST 2014


On Thursday 21 August 2014 15:18:35 Иван Комиссаров wrote:
> QString::toInt() calls:
> QString::toIntegral_helper() (which has "if (ok)" check) which calls:
> QLocaleData::stringToLongLong (which again has "if (ok)" check); calls:
> QLocaleData::numberToCLocale (return bool, fuuuh) OR
> QLocaleData::bytearrayToLongLong (has 4 (FOUR) "if (ok)" checks)
> 
> Conclusion - we have 6 identical checks which can be avoided using QOptional

toIntegral_helper has no if (ok) check:

And the QOptional copying would also have a boolean check.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list