Code review comment for lp://staging/~aacid/thumbnailer/fast_string_concatenation

Revision history for this message
Albert Astals Cid (aacid) wrote :

It is not always about speed but also less allocations happening meaning the memory gets less fragmented which is as well interesting for long lived apps.

As for wheter

- string inpath = (artist_ + "_" + album_).toStdString() + "_" + suffix;
+ string inpath = QString(artist_ + "_" + album_).toStdString() + "_" + suffix;

is more readable or not i guess it's up to you, but it adds some more explicitness, meaning readers that are not the ones that immediately wrote the code know that the toStdString is being called over a QString and don't have to guess the types of artist_ and album_ check if they are the same and then check the operator + with "_" still gives the same type.

« Back to merge proposal