aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-02 15:14:11 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-03-02 15:14:11 +0800
commit22d1b2423f6abe177ce8a99f460cfedd5bc7eecc (patch)
treec941fb7b1a20af34243de4ef4096e3ec2c3b2cde
parent4b3f920477e9838c3f3a9cd67a47d1494b9cc229 (diff)
downloadrneovim-22d1b2423f6abe177ce8a99f460cfedd5bc7eecc.tar.gz
rneovim-22d1b2423f6abe177ce8a99f460cfedd5bc7eecc.tar.bz2
rneovim-22d1b2423f6abe177ce8a99f460cfedd5bc7eecc.zip
refactor(PVS/V560): ap == NULL is always false
-rw-r--r--src/nvim/api/autocmd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c
index 9a8eccd22c..2e19987609 100644
--- a/src/nvim/api/autocmd.c
+++ b/src/nvim/api/autocmd.c
@@ -131,10 +131,8 @@ Array nvim_get_autocmds(Dict(get_autocmds) *opts, Error *err)
continue;
}
- for (AutoPat *ap = au_get_autopat_for_event(event);
- ap != NULL;
- ap = ap->next) {
- if (ap == NULL || ap->cmds == NULL) {
+ for (AutoPat *ap = au_get_autopat_for_event(event); ap != NULL; ap = ap->next) {
+ if (ap->cmds == NULL) {
continue;
}