Take the remaining characters of a string instead of taking none in a condition of the stringInterpolation() function from Target.hpp

This commit is contained in:
Username404 2021-09-01 19:31:04 +02:00
parent afc59c7a22
commit b5697bf0a8
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ protected:
const bool closingBraceIsNPOS = closingBrace == string::npos; const bool closingBraceIsNPOS = closingBrace == string::npos;
const bool wrongClosingBrace = !closingBraceIsNPOS && ((hasNext && closingBrace > interpolationVector[i + 1])); const bool wrongClosingBrace = !closingBraceIsNPOS && ((hasNext && closingBrace > interpolationVector[i + 1]));
if (closingBraceIsNPOS || wrongClosingBrace) { if (closingBraceIsNPOS || wrongClosingBrace) {
output << view.substr(occurrence, (hasNext ? interpolationVector[i + 1] - occurrence : 0)); output << view.substr(occurrence, (hasNext ? interpolationVector[i + 1] - occurrence : string::npos));
} }
output << closeCharacters; output << closeCharacters;
if (not closingBraceIsNPOS && not wrongClosingBrace) { if (not closingBraceIsNPOS && not wrongClosingBrace) {