Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: Patch - unnecessary actions

Project highlights: :. Download .: :. Support .: :. FAQ .: :. Translations .: :. Donate .: :. Report Bug .:

tortoisesvn
Discussion topic

Back to topic list

Re: Patch - unnecessary actions

Author otik
Full name Oto BREZINA
Date 2011-08-03 15:26:48 PDT
Message 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

« Previous message in topic | 2 of 6 | Next message in topic »

Messages

Show all messages in topic

Patch - unnecessary actions wipedout Dmitry 2011-08-02 23:05:35 PDT
     Re: Patch - unnecessary actions otik Oto BREZINA 2011-08-03 15:26:48 PDT
         Re: Patch - unnecessary actions steveking Stefan Küng 2011-08-04 09:45:27 PDT
             Re: Patch - unnecessary actions otik Oto BREZINA 2011-08-07 13:23:19 PDT
                 Re: Patch - unnecessary actions steveking Stefan Küng 2011-08-07 13:25:27 PDT
                 RE: Re: Patch - unnecessary actions klimax Daniel Klima 2011-08-08 00:25:58 PDT
Messages per page: