Re: [PATCH v7 03/17] ref-filter: implement %(if:equals=<string>) and %(if:notequals=<string>)
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Nov 11, 2016, 05:27 UTC
- Message-ID
- <CA+P7+xomLnpgM65W0TCUgO_n6XUu05jKkmQKgbUS9XxJu_46RQ@mail.gmail.com>
- In-Reply-To
- <CAOLa=ZQCP2KtgLQie5p+PBiFjiNVFduUh=AmuLWcOKX5QA_BXA@mail.gmail.com>
On Thu, Nov 10, 2016 at 9:31 AM, Karthik Nayak <karthik.188@gmail.com> wrote:
Show 14 quoted lines
> On Wed, Nov 9, 2016 at 4:52 AM, Jacob Keller <jacob.keller@gmail.com> wrote: >> On Tue, Nov 8, 2016 at 12:11 PM, Karthik Nayak <karthik.188@gmail.com> wrote: >> >> Ok. How does this handle whitespace? The previous if implementation >> treated whitespace as trimming to ignore. Does this require an exact >> whitespace match? It appears by the code that strings must match >> exactly. Would it make more sense to always trim the value of >> whitespace first before comparison? Hmm.. I think we should avoid >> doing that actually. >> > > This does not trim whitespace what so ever and requires an exact match. > I don't see the reason behind trimming whitespace though. >
The comment was made in reference to the fact that %(if)<atom>%(then) essentially trims whitespace, since if the <atom> prints only whitespace it does not match.
Thus, it might make sense to keep it all the same and have this trim as well. However, I think there is no benefit or reasoning to do so in this case.
Thanks, Jake