Parsing hints from request. If no hint is given, then it is initialized

to empty string.
This commit is contained in:
DennisOSRM 2012-03-05 16:19:46 +01:00
parent c273351d4a
commit f7cc34c807
2 changed files with 2 additions and 8 deletions

View File

@ -26,7 +26,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include "../DataStructures/HashTable.h"
struct RouteParameters {
std::vector<unsigned> hints;
std::vector<std::string> hints;
std::vector<std::string> parameters;
std::vector<std::string> viaPoints;
HashTable<std::string, std::string> options;

View File

@ -85,13 +85,7 @@ public:
}
} else if("hint" == p) {
routeParameters.hints.resize(routeParameters.viaPoints.size(), 0);
if(routeParameters.hints.size()) {
unsigned hint = 0;
try {
hint = 10*boost::lexical_cast<int>(o);
} catch(boost::bad_lexical_cast &) { /* do nothing since hint is initialized to 0 */}
routeParameters.hints.back() = hint;
}
routeParameters.hints.back() = o;
} else {
routeParameters.options.Set(p, o);
}