Re: [PATCH 1/1] Bypass expensive content comparsion during rename detection.
- From
Shawn Pearce <spearce@spearce.org>
- Date
- Dec 14, 2006, 11:13 UTC
- Message-ID
- <20061214111304.GF1747@spearce.org>
- In-Reply-To
- <20061214110858.GE1747@spearce.org>
Shawn Pearce <spearce@spearce.org> wrote:
> I'll admit, I don't understand the diffcore rename code very well > so I'm treading around in code that I'm not used to. I'm not sure > why the size member of diff_filespec needs to be initialized to get > rename and copy detection to work properly, but it apparently does.
This chunk of code is probably a perfect example of why side-effects can be so bad. Its fast because the size information is loaded once and reused later on; its horrible to maintain because you don't realize that this simple predicate is actually doing something that matters downstream even though it returned false!