Skip to content

Commit

Permalink
Better version of config line parsing
Browse files Browse the repository at this point in the history
Uses String.find_first_of method instead of custom bicycle.
  • Loading branch information
dmedvinsky committed Aug 24, 2011
1 parent 3c5ee90 commit 70823ba
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,8 @@ void Config::parseLine(string line)
if (!line.length() || line[0] == '#') {
return;
}
int pos, len = line.length();
for (pos = 0; pos < len; pos++) {
if (line[pos] == '=') {
break;
}
}
if (pos == -1) {
size_t pos = line.find_first_of('=');
if (pos == string::npos) {
return;
}
string var = strip(line.substr(0, pos));
Expand Down

0 comments on commit 70823ba

Please sign in to comment.