Skip to content

Commit f52d331

Browse files
committed
fix
1 parent d2bf079 commit f52d331

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/deep_model.cc

+3-14
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)