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

Patch - code duplication in SVNStatusListCtrl

From: Dmitry <wipedout_at_yandex.ru>
Date: Tue, 18 Jan 2011 10:48:14 +0300

Hey.

Attached is an untested patch that reduces code duplication and removes an unused tstring variable in SVNStatusListCtrl.

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?

Best wishes.
Dmitry.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2698844

To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2011-01-18 08:48:24 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.