Use base::StringToInt() instead of std::stringstream

This commit is contained in:
Tan Wang Leng 2017-02-04 09:42:52 +08:00 committed by Kevin Sawicki
parent 42f65c52fb
commit 7ec88d16a6

View file

@ -5,7 +5,6 @@
#include "atom/browser/web_contents_preferences.h"
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
@ -225,11 +224,10 @@ bool WebContentsPreferences::ConvertValueToIntegerFromString(
return true;
}
std::string stringValue;
base::string16 stringValue;
if (pref->web_preferences_.GetString(attributeName, &stringValue)) {
std::stringstream(stringValue) >> *intValue;
return true;
return base::StringToInt(stringValue, intValue);
}
return false;