From 83bdef4bfacdfb0dc206b369a9f08b6ebc73ebe0 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Mon, 15 Jun 2015 19:50:37 +0300 Subject: [PATCH] Replaced for-cycle to std::transform in generateCross function --- src/crossgen.hpp | 11 ++++++++--- wxCrossGen/wxCrossGen.mk | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/crossgen.hpp b/src/crossgen.hpp index c935ee6..546be5d 100644 --- a/src/crossgen.hpp +++ b/src/crossgen.hpp @@ -248,9 +248,14 @@ void generateCross(GridType &grid, const DictType &dict, std::vector & std::reverse(words_trans_out.begin(), words_trans_out.end()); BackedCharsTransType bctt = getFromCharsTransed(trans_type); words_out.clear(); - for (auto it = words_trans_out.begin(); it != words_trans_out.end(); ++it){ - words_out.push_back(getFromTransed(*it, bctt)); - } + words_out.resize(words_trans_out.size()); + std::transform( + words_trans_out.begin(), + words_trans_out.end(), + words_out.begin(), [bctt](const TransedWord &tw){ + return getFromTransed(tw, bctt); + } + ); } #endif // CROSSGEN_HPP diff --git a/wxCrossGen/wxCrossGen.mk b/wxCrossGen/wxCrossGen.mk index e64633b..e015540 100644 --- a/wxCrossGen/wxCrossGen.mk +++ b/wxCrossGen/wxCrossGen.mk @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=Aleksey Lobanov -Date :=14/06/15 +Date :=15/06/15 CodeLitePath :="/home/alex/.codelite" LinkerName :=/usr/bin/g++-4.8 SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC