[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Patch - code duplication in SVNStatusListCtrl

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Tue, 18 Jan 2011 21:29:37 +0100

On 18.01.2011 08:48, Dmitry wrote:
> Hey.
>
> Attached is an untested patch that reduces code duplication and
> removes an unused tstring variable in SVNStatusListCtrl.

Committed with some small changes in r20732.

> I don't quite like the for-loop that now will be inside
> CSVNStatusListCtrl::BuildIgnoreList(). It goes up the indices and
> overwrites the "value" variable. I suppose there's no side-effect in
> the loop body.
>
> If more than one match is possible is it will unnecessarily overwrite
> "value" until it finds the last match. If the logic behind that code
> is that there's no more than one match ever then there's no need to
> continue running the loop after the first match. In the first case
> the loop should go down the indices and break on first match, in the
> second case it should go up the indices and break on the first
> match.
>
> Do I get it right?

Yes, that's right. Breaking out of the loop when the property is found
is actually the correct thing to do: there can only be one svn:ignored
property.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2698952
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-01-18 21:29:53 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.