[Interest] Qmap insert versus operator[]

Konstantin Tokarev annulen at yandex.ru
Tue Nov 5 13:54:13 CET 2013


05.11.2013, 16:45, "Olivier BARTHELEMY" <barthelemy at geovariances.com>:
> Hi,
> Given code that would look like :
>
> QMap<SomeType> theMap;
> ....
> {
>   theMap[someIndex] = someValue;
> }
>
> Is it safe to assume that replacing the operator with the insert method will improve the performance for new elements (copy constructor used directly instead of default constructor + assignment operator ), while not being slower for the modification of an element that already exists?

Use profiler.

-- 
Regards,
Konstantin



More information about the Interest mailing list