mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.0.0878: Coverity warns for dead code (#21053)
Problem: Coverity warns for dead code.
Solution: Remove the dead code.
b298fe6cba
Nvim has refactored this function and does not have the dead code.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
parent
e8cc489acc
commit
3060432007
@ -124,7 +124,7 @@ void init_history(void)
|
|||||||
// Tables are circular arrays (current position marked by hisidx[type]).
|
// Tables are circular arrays (current position marked by hisidx[type]).
|
||||||
// On copying them to the new arrays, we take the chance to reorder them.
|
// On copying them to the new arrays, we take the chance to reorder them.
|
||||||
for (int type = 0; type < HIST_COUNT; type++) {
|
for (int type = 0; type < HIST_COUNT; type++) {
|
||||||
histentry_T *temp = (newlen
|
histentry_T *temp = (newlen > 0
|
||||||
? xmalloc((size_t)newlen * sizeof(*temp))
|
? xmalloc((size_t)newlen * sizeof(*temp))
|
||||||
: NULL);
|
: NULL);
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ void init_history(void)
|
|||||||
|
|
||||||
// clear remaining space, if any
|
// clear remaining space, if any
|
||||||
int l3 = j < 0 ? 0 : MIN(newlen, oldlen); // number of copied entries
|
int l3 = j < 0 ? 0 : MIN(newlen, oldlen); // number of copied entries
|
||||||
if (newlen) {
|
if (newlen > 0) {
|
||||||
memset(temp + l3, 0, (size_t)(newlen - l3) * sizeof(*temp));
|
memset(temp + l3, 0, (size_t)(newlen - l3) * sizeof(*temp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user