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

Re: Patch - unnecessary actions

From: Oto BREZINA <otik_at_printflow.eu>
Date: Thu, 04 Aug 2011 00:26:44 +0200

On 2011-08-03 8:05, Dmitry wrote:
> Hey.
>
> Attached is an untested patch that addresses hardcoded constants and also code that uncodnitionally does a change and then conditionaly overrides it instead of doing one of two changes depending on condition.
According how is defined macro
ADDTOCLIPBOARDSTRING(x) sClipboard += sClipboard.IsEmpty() ? x : L"\t" + x

sequences like:
          if (selection & SVNSLC_COLREMOTEREVISION)
          {
              if (entry->remoterev <= 0)
                  temp.Empty();
             else
                 temp.Format(_T("%ld"), entry->remoterev);
              ADDTOCLIPBOARDSTRING(temp);
          }

can become to:

          if (selection & SVNSLC_COLREMOTEREVISION)
          {
              if (entry->remoterev > 0)
              {
                 temp.Format(_T("%ld"), entry->remoterev);
                 ADDTOCLIPBOARDSTRING(temp);
              }
          }

or maybe have two macros one for unconditionally add nonempty string one
as is would make code even cleaner removing unnecessary tests and adding
empty strings

Side question how good is VS to use merged strings? From my expirence
using single object (CString) save some conversions and space. This is
minor trought.
> Best wishes.
> Dmitry.
Oto

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

To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-08-04 00:26:46 CEST

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.