mirror of
https://github.com/hyprwm/hyprlang.git
synced 2026-05-05 15:37:59 +02:00
Use size_t type. Improved formatting.
This commit is contained in:
parent
0de9282964
commit
884462a5a4
1 changed files with 6 additions and 6 deletions
|
|
@ -701,7 +701,7 @@ CParseResult CConfig::parseLine(std::string line, bool dynamic) {
|
|||
// Right now only expression parsing has escapeable chars
|
||||
const char ESCAPE_CHAR = '\\';
|
||||
const std::array<char, 2> ESCAPE_SET{'{', '}'};
|
||||
for (long i = 0; i < (long)RHS.length() - (long)1; i++) {
|
||||
for (size_t i = 0; RHS.length() != 0 && i < RHS.length() - 1; i++) {
|
||||
if (RHS.at(i) != ESCAPE_CHAR)
|
||||
continue;
|
||||
//if escaping an escape, remove and skip the next char
|
||||
|
|
@ -710,11 +710,11 @@ CParseResult CConfig::parseLine(std::string line, bool dynamic) {
|
|||
continue;
|
||||
}
|
||||
//checks if any of the chars were escapable.
|
||||
for (unsigned int j = 0; j < ESCAPE_SET.size(); j++) {
|
||||
if (RHS.at(i + 1) == ESCAPE_SET[j]) {
|
||||
RHS.erase(i--, 1);
|
||||
break;
|
||||
}
|
||||
for (size_t j = 0; j < ESCAPE_SET.size(); j++) {
|
||||
if (RHS.at(i + 1) != ESCAPE_SET[j])
|
||||
continue;
|
||||
RHS.erase(i--, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue