diff options
author | ZyX <kp-pav@yandex.ru> | 2018-04-22 20:08:49 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2018-04-22 20:08:49 +0300 |
commit | 2a951d16a42216c71c78f42b2de7343b116497e0 (patch) | |
tree | e4e8cef3529bd6109f11865b33b297cf3137e6c7 /src | |
parent | 5ba267722cb99b91fedaeae28cc6054072add5c8 (diff) | |
download | rneovim-2a951d16a42216c71c78f42b2de7343b116497e0.tar.gz rneovim-2a951d16a42216c71c78f42b2de7343b116497e0.tar.bz2 rneovim-2a951d16a42216c71c78f42b2de7343b116497e0.zip |
syntax: Silence PVS/V522: retval is always non-NULL on this round
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/syntax.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 261952cb7c..8168ace6f6 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5321,18 +5321,19 @@ get_id_list ( for (int i = highlight_ga.ga_len; --i >= 0; ) { if (vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) { if (round == 2) { - /* Got more items than expected; can happen - * when adding items that match: - * "contains=a.*b,axb". - * Go back to first round */ + // Got more items than expected; can happen + // when adding items that match: + // "contains=a.*b,axb". + // Go back to first round. if (count >= total_count) { xfree(retval); round = 1; - } else - retval[count] = i + 1; + } else { + retval[count] = i + 1; // -V522 + } } - ++count; - id = -1; /* remember that we found one */ + count++; + id = -1; // Remember that we found one. } } vim_regfree(regmatch.regprog); @@ -5346,12 +5347,13 @@ get_id_list ( } if (id > 0) { if (round == 2) { - /* Got more items than expected, go back to first round */ + // Got more items than expected, go back to first round. if (count >= total_count) { xfree(retval); round = 1; - } else + } else { retval[count] = id; + } } ++count; } |