forked from aniani/vim
patch 9.0.1236: code in same_leader() can be simplified
Problem: Code in same_leader() can be simplified. Solution: Simplify code that is executed only once. (closes #11867)
This commit is contained in:
@@ -540,9 +540,6 @@ same_leader(
|
|||||||
if (leader1_len == 0)
|
if (leader1_len == 0)
|
||||||
return (leader2_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
|
// If first leader has 'f' flag, the lines can be joined only if the
|
||||||
// second line does not have a leader.
|
// second line does not have a leader.
|
||||||
// If first leader has 'e' flag, the lines can never be joined.
|
// If first leader has 'e' flag, the lines can never be joined.
|
||||||
@@ -558,11 +555,7 @@ same_leader(
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
if (*p == COM_START)
|
if (*p == COM_START)
|
||||||
{
|
{
|
||||||
if (lnum_line == NULL)
|
int line_len = (int)STRLEN(ml_get(lnum));
|
||||||
{
|
|
||||||
lnum_line = ml_get(lnum);
|
|
||||||
line_len = (int)STRLEN(lnum_line);
|
|
||||||
}
|
|
||||||
if (line_len <= leader1_len)
|
if (line_len <= leader1_len)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (leader2_flags == NULL || leader2_len == 0)
|
if (leader2_flags == NULL || leader2_len == 0)
|
||||||
|
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1236,
|
||||||
/**/
|
/**/
|
||||||
1235,
|
1235,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user