Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2017-11-30 17:21:00 +0300
committerVladimir Byko-Ianko <bykoianko@gmail.com>2017-12-01 19:01:23 +0300
commitcb246cd613709478dd4d805693705172d091d0ed (patch)
treed37e9a5074b17ccae420b99a7df98e7ce6875e85 /feature_list/feature_list.cpp
parentb5b0d8eb3371b05dda5fdd861e695359fca14b24 (diff)
[base] ControlFlow.
The convention we used to break a ForEach loop prematurely was to return false from the function object that was being called by ForEach. Now the function object must return a special enum, thus making the intention more readable.
Diffstat (limited to 'feature_list/feature_list.cpp')
-rw-r--r--feature_list/feature_list.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/feature_list/feature_list.cpp b/feature_list/feature_list.cpp
index 4f3371f27b..e83aed49f8 100644
--- a/feature_list/feature_list.cpp
+++ b/feature_list/feature_list.cpp
@@ -25,6 +25,8 @@
#include "storage/index.hpp"
#include "storage/storage.hpp"
+#include "base/control_flow.hpp"
+
#include "std/algorithm.hpp"
#include "std/iostream.hpp"
@@ -120,10 +122,9 @@ string BuildUniqueId(ms::LatLon const & coords, string const & name)
void AppendNames(FeatureType const & f, vector<string> & columns)
{
vector<string> names(kLangCount);
- f.GetNames().ForEach([&names](int8_t code, string const & name) -> bool
- {
+ f.GetNames().ForEach([&names](int8_t code, string const & name) -> base::ControlFlow {
names[code] = string(name);
- return true;
+ return base::ControlFlow::Continue;
});
columns.insert(columns.end(), next(names.begin()), names.end());
}