File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -99,20 +99,9 @@ int main(int argc, char* argv[]) {
9999 for (std::string feature: features) {
100100 std::vector<std::string> tokens;
101101 util::split (feature, ' :' , tokens);
102- int64 fieldid;
103- int64 featureid;
104- float value;
105- int i = 0 ;
106- for (std::string token: tokens) {
107- if (i == 0 ) {
108- fieldid = std::stoi (token);
109- } else if (i == 1 ) {
110- featureid = std::stoi (token);
111- } else if (i == 2 ) {
112- value = std::stof (token);
113- }
114- i++;
115- }
102+ int64 fieldid = std::stoi (tokens[0 ]);
103+ int64 featureid std::stoi (tokens[1 ]);
104+ float value = std::stof (tokens[2 ]);
116105 if (instance.find (fieldid) == instance.end ()) {
117106 std::unordered_map<int64, float > f;
118107 f[featureid] = value;
You can’t perform that action at this time.
0 commit comments