git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin/apply.c: fuzzy_matchlines:trying to fix some inefficiencies

From
George Papanikolaou <g3orge.app@gmail.com>
Date
Mar 20, 2014, 10:58 UTC
Message-ID
<CAByyCQAsjoBiv54PR+AP=2ci60o39TNw5FhM0aNOhzbZpLd7gg@mail.gmail.com>
In-Reply-To
<532ABBE1.4090001@alum.mit.edu>

Hi, Thanks for the feedback,

On Thu, Mar 20, 2014 at 11:58 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 5 quoted lines
>
> Why is this an improvement?  Do you expect this function to be called
> often for empty lines (as opposed, for example, to lines consisting
> solely of whitespace characters)?
>

Yes, you are probably right, we are not gonna get much (if any) completely empty lines

Show 6 quoted lines
>
> The comment just above this change gives a justification for putting an
> "if" statement surrounding the "while" statements.  Do you think the
> comment's argument is incorrect?  If so, please explain why, and remove
> or change the comment.
>

I see what I did wrong. I thought since that the if-condition is double checked (from the while clause) so I removed it.

Also this lead me to see that since the while clause is now unconditioned, there is no point of it being replicated exactly the same above, so I removed that too. =(

I'm trying to find other inefficiencies/irregularities on that function. I'm currently thinking on merging the first checks with a call to iswspace() or something similar.

Also thanks for clarifying the way patches/mails work.
Cheers.

--- papanikge's surrogate email. I may reply back. http://www.5slingshots.com/

Previous: Michael Haggerty
Message 3 of 3 in “builtin/apply.c: fuzzy_matchlines:trying to fix some inefficiencies”
  1. builtin/apply.c: fuzzy_matchlines:trying to fix some inefficienciesGeorge Papanikolaou, Mar 20, 2014
  2. Michael HaggertyMar 20, 2014
  3. George PapanikolaouMar 20, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.