std::stoi instead of stringstream

This commit is contained in:
Eric Harding committed 2018-02-28 13:35:00 -05:00
1 parent 408bff4c82
commit 9fab67e938
1 file changed
+1 -10
+1 -10
View File
@@ -127,18 +127,10 @@ void run_rectool(const vector<string> args) {
}
}
int str2int(const string& s) {
std::stringstream ss(s);
int i;
ss >> i;
if (ss.fail()) return -1;
return i;
}
void dump_db(const vector<string> args) {
set<security_key> keys;
for (const auto& arg : args) {
auto key = str2int(arg);
auto key = std::stoi(arg);
if (key > 0) {
keys.insert(key);
}
@@ -150,7 +142,6 @@ void dump_db(const vector<string> args) {
security.PrintDebugString();
}
});
}