mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI2: Simplify code by using const quote string
The "\'" string is equal to "'", which is already stored in the quote variable, so we might as well use that. Thanks to Sebastian Uharek for the review suggestion.
This commit is contained in:
parent
2619435148
commit
8b30046d0a
1 changed files with 2 additions and 2 deletions
|
@ -418,7 +418,7 @@ void CLI2::lexArguments ()
|
|||
// Process multiple-token arguments.
|
||||
else
|
||||
{
|
||||
std::string quote = "'";
|
||||
const std::string quote = "'";
|
||||
|
||||
// Escape unescaped single quotes
|
||||
std::string escaped = "";
|
||||
|
@ -434,7 +434,7 @@ void CLI2::lexArguments ()
|
|||
if (!nextEscaped && (character == "\\"))
|
||||
nextEscaped = true;
|
||||
else {
|
||||
if (character == "\'" && !nextEscaped)
|
||||
if (character == quote && !nextEscaped)
|
||||
escaped += "\\";
|
||||
nextEscaped = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue