Patch 9.0.1236
Problem:    Code in same_leader() can be simplified.
Solution:   Simplify code that is executed only once. (closes #11867)
Files:      src/textformat.c


*** ../vim-9.0.1235/src/textformat.c    2023-01-21 13:09:15.582541093 +0000
--- src/textformat.c    2023-01-23 16:51:58.732164399 +0000
***************
*** 540,548 ****
      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.
--- 540,545 ----
***************
*** 558,568 ****
                return FALSE;
            if (*p == COM_START)
            {
!               if (lnum_line == NULL)
!               {
!                   lnum_line = ml_get(lnum);
!                   line_len = (int)STRLEN(lnum_line);
!               }
                if (line_len <= leader1_len)
                    return FALSE;
                if (leader2_flags == NULL || leader2_len == 0)
--- 555,561 ----
                return FALSE;
            if (*p == COM_START)
            {
!               int line_len = (int)STRLEN(ml_get(lnum));
                if (line_len <= leader1_len)
                    return FALSE;
                if (leader2_flags == NULL || leader2_len == 0)
*** ../vim-9.0.1235/src/version.c       2023-01-23 12:33:15.826715782 +0000
--- src/version.c       2023-01-23 16:56:24.792377526 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1236,
  /**/

-- 
The 50-50-90 rule: Anytime you have a 50-50 chance of getting
something right, there's a 90% probability you'll get it wrong.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230123165736.609E71C08EE%40moolenaar.net.

Raspunde prin e-mail lui