diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-23 16:57:08 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-23 16:57:08 +0000 |
commit | 9cbf791995514e72476399fe06e055a707ec0158 (patch) | |
tree | 3ad8aa2f4a83fe56a0c66e084f651335256198b3 | |
parent | dc7179f9a4cc74d864d1f6414e691d25bac8f831 (diff) | |
download | vim-git-9cbf791995514e72476399fe06e055a707ec0158.tar.gz |
patch 9.0.1236: code in same_leader() can be simplifiedv9.0.1236
Problem: Code in same_leader() can be simplified.
Solution: Simplify code that is executed only once. (closes #11867)
-rw-r--r-- | src/textformat.c | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/textformat.c b/src/textformat.c index 7ebbc8849..3447a0a0e 100644 --- a/src/textformat.c +++ b/src/textformat.c @@ -540,9 +540,6 @@ same_leader( if (leader1_len == 0) return (leader2_len == 0); - char_u *lnum_line = NULL; - int line_len = 0; - // If first leader has 'f' flag, the lines can be joined only if the // second line does not have a leader. // If first leader has 'e' flag, the lines can never be joined. @@ -558,11 +555,7 @@ same_leader( return FALSE; if (*p == COM_START) { - if (lnum_line == NULL) - { - lnum_line = ml_get(lnum); - line_len = (int)STRLEN(lnum_line); - } + int line_len = (int)STRLEN(ml_get(lnum)); if (line_len <= leader1_len) return FALSE; if (leader2_flags == NULL || leader2_len == 0) diff --git a/src/version.c b/src/version.c index 3e853b309..886d0a4df 100644 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1236, +/**/ 1235, /**/ 1234, |