Skip to content

Commit

Permalink
[clang-tidy] use bool literals (jbeder#881)
Browse files Browse the repository at this point in the history
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb authored Jun 15, 2020
1 parent 4f6d073 commit 4c90f29
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ std::vector<Node> LoadAll(std::istream& input) {
std::vector<Node> docs;

Parser parser(input);
while (1) {
while (true) {
NodeBuilder builder;
if (!parser.HandleNextDocument(builder)) {
break;
Expand Down
4 changes: 2 additions & 2 deletions src/scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Token& Scanner::peek() {
Mark Scanner::mark() const { return INPUT.mark(); }

void Scanner::EnsureTokensInQueue() {
while (1) {
while (true) {
if (!m_tokens.empty()) {
Token& token = m_tokens.front();

Expand Down Expand Up @@ -174,7 +174,7 @@ void Scanner::ScanNextToken() {
}

void Scanner::ScanToNextToken() {
while (1) {
while (true) {
// first eat whitespace
while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
Expand Down
2 changes: 1 addition & 1 deletion src/scantoken.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void Scanner::ScanDirective() {
token.value += INPUT.get();

// read parameters
while (1) {
while (true) {
// first get rid of whitespace
while (Exp::Blank().Matches(INPUT))
INPUT.eat(1);
Expand Down
10 changes: 5 additions & 5 deletions src/singledocparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void SingleDocParser::HandleBlockSequence(EventHandler& eventHandler) {
m_scanner.pop();
m_pCollectionStack->PushCollectionType(CollectionType::BlockSeq);

while (1) {
while (true) {
if (m_scanner.empty())
throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ);

Expand Down Expand Up @@ -199,7 +199,7 @@ void SingleDocParser::HandleFlowSequence(EventHandler& eventHandler) {
m_scanner.pop();
m_pCollectionStack->PushCollectionType(CollectionType::FlowSeq);

while (1) {
while (true) {
if (m_scanner.empty())
throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_SEQ_FLOW);

Expand Down Expand Up @@ -252,7 +252,7 @@ void SingleDocParser::HandleBlockMap(EventHandler& eventHandler) {
m_scanner.pop();
m_pCollectionStack->PushCollectionType(CollectionType::BlockMap);

while (1) {
while (true) {
if (m_scanner.empty())
throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP);

Expand Down Expand Up @@ -291,7 +291,7 @@ void SingleDocParser::HandleFlowMap(EventHandler& eventHandler) {
m_scanner.pop();
m_pCollectionStack->PushCollectionType(CollectionType::FlowMap);

while (1) {
while (true) {
if (m_scanner.empty())
throw ParserException(m_scanner.mark(), ErrorMsg::END_OF_MAP_FLOW);

Expand Down Expand Up @@ -376,7 +376,7 @@ void SingleDocParser::ParseProperties(std::string& tag, anchor_t& anchor,
anchor_name.clear();
anchor = NullAnchor;

while (1) {
while (true) {
if (m_scanner.empty())
return;

Expand Down

0 comments on commit 4c90f29

Please sign in to comment.