remove (almost) all BOOST_FOREACH calls

This commit is contained in:
Dennis Luxen
2014-05-07 16:17:47 +02:00
parent e3244dd649
commit 9710f39cad
12 changed files with 32 additions and 45 deletions
+2 -3
View File
@@ -36,7 +36,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/regex.hpp>
#include <boost/foreach.hpp>
#include <boost/regex.hpp>
BaseParser::BaseParser(
@@ -76,7 +75,7 @@ void BaseParser::ReadRestrictionExceptions() {
const unsigned exception_count = restriction_exceptions.size();
SimpleLogger().Write() <<
"Found " << exception_count << " exceptions to turn restrictions:";
BOOST_FOREACH(const std::string & str, restriction_exceptions) {
for(const std::string & str : restriction_exceptions) {
SimpleLogger().Write() << " " << str;
}
} else {
@@ -124,7 +123,7 @@ bool BaseParser::ShouldIgnoreRestriction(
//only a few exceptions are actually defined.
std::vector<std::string> exceptions;
boost::algorithm::split_regex(exceptions, except_tag_string, boost::regex("[;][ ]*"));
BOOST_FOREACH(std::string& current_string, exceptions) {
for (std::string& current_string : exceptions) {
std::vector<std::string>::const_iterator string_iterator;
string_iterator = std::find(
restriction_exceptions.begin(),
+3 -4
View File
@@ -31,7 +31,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../Util/SimpleLogger.h"
#include <boost/assert.hpp>
#include <boost/foreach.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
@@ -461,7 +460,7 @@ void ExtractionContainers::PrepareData(
//compute total number of chars
unsigned total_number_of_chars = 0;
BOOST_FOREACH(const std::string & temp_string, name_list) {
for (const std::string & temp_string : name_list) {
total_number_of_chars += temp_string.length();
}
//write total number of chars
@@ -471,7 +470,7 @@ void ExtractionContainers::PrepareData(
);
//write prefixe sums
unsigned name_lengths_prefix_sum = 0;
BOOST_FOREACH(const std::string & temp_string, name_list) {
for (const std::string & temp_string : name_list) {
name_file_stream.write(
(char *)&(name_lengths_prefix_sum),
sizeof(unsigned)
@@ -485,7 +484,7 @@ void ExtractionContainers::PrepareData(
);
//write all chars consecutively
BOOST_FOREACH(const std::string & temp_string, name_list) {
for (const std::string & temp_string : name_list) {
const unsigned string_length = temp_string.length();
name_file_stream.write(temp_string.c_str(), string_length);
}
+2 -3
View File
@@ -42,7 +42,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <osrm/Coordinate.h>
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include <boost/ref.hpp>
@@ -226,7 +225,7 @@ inline void PBFParser::parseDenseNode(_ThreadData * threadData) {
}
}
BOOST_FOREACH(const ImportNode &import_node, extracted_nodes_vector)
for(const ImportNode &import_node : extracted_nodes_vector)
{
extractor_callbacks->nodeFunction(import_node);
}
@@ -365,7 +364,7 @@ inline void PBFParser::parseWay(_ThreadData * threadData) {
}
}
BOOST_FOREACH(ExtractionWay & extraction_way, parsed_way_vector)
for(ExtractionWay & extraction_way : parsed_way_vector)
{
if (2 <= extraction_way.path.size())
{