mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0501: cppcheck warns for using array index before bounds check (#9178)
Problem: Cppcheck warns for using array index before bounds check.
Solution: Swap the conditions. (Dominique Pelle)
a9a8e04eab
This commit is contained in:
parent
b24209dcf5
commit
f9fe903579
@ -3709,9 +3709,9 @@ static void ml_updatechunk(buf_T *buf, linenr_T line, long len, int updtype)
|
||||
curix++) {
|
||||
curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
|
||||
}
|
||||
} else if (line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines
|
||||
&& curix < buf->b_ml.ml_usedchunks - 1) {
|
||||
/* Adjust cached curix & curline */
|
||||
} else if (curix < buf->b_ml.ml_usedchunks - 1
|
||||
&& line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines) {
|
||||
// Adjust cached curix & curline
|
||||
curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
|
||||
curix++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user