Skip to content

Commit

Permalink
Address reviewer's comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Dec 4, 2019
1 parent 6043299 commit 0abb423
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/tree/param.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
*/
#include <iostream>
#include <vector>
#include <utility>

#include "param.h"

namespace std {
std::istream &operator>>(std::istream &is, std::vector<int> &t) {
t.clear();
// get (
while (true) {
char ch = is.peek();
if (isdigit(ch)) {
int idx;
if (is >> idx) {
t.assign(&idx, &idx + 1);
t.emplace_back(idx);
}
return is;
}
Expand Down Expand Up @@ -73,7 +75,7 @@ std::istream &operator>>(std::istream &is, std::vector<int> &t) {
return is;
}
}
t.assign(tmp.begin(), tmp.end());
t = std::move(tmp);
return is;
}
} // namespace std
2 changes: 1 addition & 1 deletion src/tree/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2014 by Contributors
* \file param.h
* \brief training parameters, statistics used to support tree construction.
n * \author Tianqi Chen
* \author Tianqi Chen
*/
#ifndef XGBOOST_TREE_PARAM_H_
#define XGBOOST_TREE_PARAM_H_
Expand Down

0 comments on commit 0abb423

Please sign in to comment.