Skip to content

Commit

Permalink
Removed the if condition to make code more concise.
Browse files Browse the repository at this point in the history
- Instead of checking for `if` condition to populate the `isQuoted` var, we can directly use the boolean result of `!=` relational operator to populate the variable.

- This makes the code concise and more easier to debug and dry-run the while loop.
  • Loading branch information
Mayank authored and QuietMisdreavus committed May 30, 2023
1 parent e24d66a commit 8ea3072
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Sources/Markdown/Parser/BlockDirectiveParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,7 @@ struct TrimmedLine {
isEscaped = true
}
else if isQuoted {
if c == "\"" {
isQuoted = false
}
isQuoted = (c != "\"")
}
else if allowQuote,
c == "\"" {
Expand Down

0 comments on commit 8ea3072

Please sign in to comment.