Skip to content
Browse files

Better version of config line parsing

Uses String.find_first_of method instead of custom bicycle.
  • Loading branch information...
1 parent 3c5ee90 commit 70823ba4e73838b9d89621a6e3086406828be0fd @dmedvinsky dmedvinsky committed
Showing with 2 additions and 7 deletions.
  1. +2 −7 src/Config.cpp
View
9 src/Config.cpp
@@ -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));

0 comments on commit 70823ba

Please sign in to comment.
Something went wrong with that request. Please try again.