|This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/106646/|
On November 9th, 2013, 2:05 p.m. UTC, Michel Ludwig wrote:
src/utilities.cpp (Diff revision 1) 72 QString KileUtilities::lastModifiedFile(const QStringList& files, const QString& baseDir)Hehe, this is a nice example of how to use encapsulated algorithms, but I'm afraid it makes the code almost unreadable... Would you mind changing it a bit so that it becomes easier to understand again?
On November 11th, 2013, 11:15 a.m. UTC, Eugene Shalygin wrote:I'm afraid that I'm not sure that understand you correctly. Do you want to avoid usage of the <algorithm> and replace it with, say, Q_FOREACH and a couple of local variables? I thought that <algorithm> makes code more readable, since everybody knows what functions from it do, and small predicate classes are really easy to understand. Therefore I'm not sure and thus could you, pleaas, confirm?
Yes, exactly. I think the use of max_element can be justified but this line almost gives me a headache ;) std::transform(files.begin(), files.end(), std::back_inserter(absoluteFileNames), FilePathConcatenate(baseDir)); Questions that spring to my mind are: What does 'transform' do? What is a 'back_inserter'? What does 'FilePathConcatenate' do? I think the loop that was there previously was slightly easier to understand :)
On October 8th, 2013, 12:58 a.m. UTC, Eugene Shalygin wrote:
Review request for Kile and Michel Ludwig.
By Eugene Shalygin.
Updated Oct. 8, 2013, 12:58 a.m.