review feedback

This commit is contained in:
Thomas Van Lenten 2021-10-01 14:31:26 -04:00
parent a9e1d7c177
commit be37b08a31
2 changed files with 5 additions and 7 deletions

View File

@ -1638,7 +1638,7 @@ class Parser {
Parser(LineConsumer* line_consumer)
: line_consumer_(line_consumer), line_(0) {}
// Feeds in some input, prase what it can, returning success/failure. Calling
// Feeds in some input, parse what it can, returning success/failure. Calling
// again after an error is undefined.
bool ParseChunk(StringPiece chunk, std::string* out_error);

View File

@ -251,13 +251,11 @@ class TestLineCollector : public LineConsumer {
: lines_(inout_lines), reject_(reject_line), skip_msg_(skip_msg) {}
bool ConsumeLine(const StringPiece& line, std::string* out_error) override {
if (reject_) {
if (*reject_ == line) {
if (!skip_msg_) {
*out_error = std::string("Rejected '") + *reject_ + "'";
}
return false;
if (reject_ && *reject_ == line) {
if (!skip_msg_) {
*out_error = std::string("Rejected '") + *reject_ + "'";
}
return false;
}
if (lines_) {
lines_->emplace_back(line);