Skip to content

Commit

Permalink
Clang tidy.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jul 24, 2019
1 parent ff849f6 commit fcc9386
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/common/json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ void JsonReader::Error(std::string msg) const {
msg += ", around character: " + std::to_string(cursor_.Pos());
msg += '\n';

constexpr size_t extend = 8;
auto beg = cursor_.Pos() - extend < 0 ? 0 : cursor_.Pos() - extend;
auto end = cursor_.Pos() + extend >= raw_str_.size() ?
raw_str_.size() : cursor_.Pos() + extend;
constexpr size_t kExtend = 8;
auto beg = cursor_.Pos() - kExtend < 0 ? 0 : cursor_.Pos() - kExtend;
auto end = cursor_.Pos() + kExtend >= raw_str_.size() ?
raw_str_.size() : cursor_.Pos() + kExtend;

msg += " ";
msg += raw_str_.substr(beg, end - beg);
Expand Down

0 comments on commit fcc9386

Please sign in to comment.