mirror of
https://github.com/neovim/neovim.git
synced 2025-11-26 12:10:40 +00:00
syntax: Fix PVS/V547: condition was checked
In surrounding if() `off` was checked for being non-zero and in previous if() it was checked for being positive.
This commit is contained in:
@@ -2825,10 +2825,11 @@ syn_add_end_off (
|
||||
if (off > 0) {
|
||||
while (off-- > 0 && *p != NUL)
|
||||
mb_ptr_adv(p);
|
||||
} else if (off < 0) {
|
||||
while (off++ < 0 && base < p)
|
||||
} else {
|
||||
while (off++ < 0 && base < p) {
|
||||
mb_ptr_back(base, p);
|
||||
}
|
||||
}
|
||||
col = (int)(p - base);
|
||||
}
|
||||
result->col = col;
|
||||
@@ -2870,12 +2871,14 @@ syn_add_start_off (
|
||||
base = ml_get_buf(syn_buf, result->lnum, FALSE);
|
||||
p = base + col;
|
||||
if (off > 0) {
|
||||
while (off-- && *p != NUL)
|
||||
while (off-- && *p != NUL) {
|
||||
mb_ptr_adv(p);
|
||||
} else if (off < 0) {
|
||||
while (off++ && base < p)
|
||||
}
|
||||
} else {
|
||||
while (off++ && base < p) {
|
||||
mb_ptr_back(base, p);
|
||||
}
|
||||
}
|
||||
col = (int)(p - base);
|
||||
}
|
||||
result->col = col;
|
||||
|
||||
Reference in New Issue
Block a user