diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-11-28 19:23:57 +0100 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-11-28 19:23:57 +0100 |
commit | 898f8d1f0b9f7f1f32ebefbd557b21a148616c2c (patch) | |
tree | 5857b72f5543d30e51d8453b9626769c268fecc2 | |
parent | 35cec0de4acd351119230330f54b0a45f9823695 (diff) | |
download | rneovim-898f8d1f0b9f7f1f32ebefbd557b21a148616c2c.tar.gz rneovim-898f8d1f0b9f7f1f32ebefbd557b21a148616c2c.tar.bz2 rneovim-898f8d1f0b9f7f1f32ebefbd557b21a148616c2c.zip |
refactor(decor): remove sign conditions that are always true
-rw-r--r-- | src/nvim/decoration.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c index c2bef5920c..15d2869c48 100644 --- a/src/nvim/decoration.c +++ b/src/nvim/decoration.c @@ -725,10 +725,8 @@ void decor_redraw_signs(win_T *wp, buf_T *buf, int row, SignTextAttrs sattrs[], while (marktree_itr_step_overlap(buf->b_marktree, itr, &pair)) { if (!mt_invalid(pair.start) && mt_decor_sign(pair.start)) { DecorSignHighlight *sh = decor_find_sign(mt_decor(pair.start)); - if (sh) { - num_text += (sh->text.ptr != NULL); - kv_push(signs, ((SignItem){ sh, pair.start.id })); - } + num_text += (sh->text.ptr != NULL); + kv_push(signs, ((SignItem){ sh, pair.start.id })); } } @@ -739,10 +737,8 @@ void decor_redraw_signs(win_T *wp, buf_T *buf, int row, SignTextAttrs sattrs[], } if (!mt_end(mark) && !mt_invalid(mark) && mt_decor_sign(mark)) { DecorSignHighlight *sh = decor_find_sign(mt_decor(mark)); - if (sh) { - num_text += (sh->text.ptr != NULL); - kv_push(signs, ((SignItem){ sh, mark.id })); - } + num_text += (sh->text.ptr != NULL); + kv_push(signs, ((SignItem){ sh, mark.id })); } marktree_itr_next(buf->b_marktree, itr); @@ -826,10 +822,7 @@ int decor_signcols(buf_T *buf, int row, int end_row, int max) break; } if (!mt_invalid(mark) && !mt_end(mark) && (mark.flags & MT_FLAG_DECOR_SIGNTEXT)) { - DecorSignHighlight *sh = decor_find_sign(mt_decor(mark)); - if (sh && sh->text.ptr) { - count++; - } + count++; } marktree_itr_next(buf->b_marktree, itr); } |