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 steveking
Full name Stefan Küng
Date 2011-08-04 09:45:27 PDT
Message On 04.08.2011 00:26, Oto BREZINA wrote:
> 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

Not really. Even if temp is empty (as it's now set if required) the tab
has to be added if the clipboard string is not empty.

Assume sClipboard contains "filename".
after the original sequence, sClipboard is either
filename\t
or
filename\tremoterev

but with your suggested sequence, it would be
filename
or
filename\tremoverev

That's not the same :)

> 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.

Can you explain in more detail what you want to do?

Stefan

--
        ___
   oo // \\ "De Chelonian Mobile"
  (_,\/ \_/ \ TortoiseSVN
    \ \_/_\_/> The coolest Interface to (Sub)Version Control
    /_/ \_\ http://tortoisesvn.net

« Previous message in topic | 3 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: