Skip to content

Commit

Permalink
Merge pull request #1 from moneymanagerex/master
Browse files Browse the repository at this point in the history
pass const ref
  • Loading branch information
heapwolf committed Mar 31, 2015
2 parents bfcced9 + 23a07ee commit 477293c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions route.cc
Expand Up @@ -4,21 +4,21 @@ namespace route {

using namespace std;

Match Route::set(string u) {
Match Route::set(const string& u) {
url = u;
path_to_regex = regex(path_pattern);
Match m(*this);
return m;
}

string Match::get(string key) {
string Match::get(const string& key) {
if (pairs.count(key)) {
return pairs.at(key);
}
return "";
}

bool Match::test(string tmpl) {
bool Match::test(const string& tmpl) {

pairs.clear();
Path path;
Expand Down
6 changes: 3 additions & 3 deletions route.h
Expand Up @@ -57,7 +57,7 @@ class Route {
// set the url for this instance, create a regex
// from the url and return a match instance.
//
Match set(string u);
Match set(const string& u);

Route(/* options */) {
//
Expand All @@ -77,8 +77,8 @@ class Match {

public:
int keys;
string get(string key);
bool test(string tmpl);
string get(const string& key);
bool test(const string& tmpl);

Match(Route &r) : route(&r) {}
~Match() {}
Expand Down

0 comments on commit 477293c

Please sign in to comment.