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

Re: Patch: reducing code duplication by using functions

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Mon, 31 Aug 2009 21:33:43 +0200

On 31.08.2009 11:49, Oto BREZINA wrote:
> I have few question/notes about this patch.
> 1.*ptr != buffer*// according some rule we (in our company - not TSVN) use comparing pointers is classified as not safe

It's safe if done right. It's just easy to mess it up.

> 2. using ptr[i] is faster anyway - according intel optimazition manual (at least as i remmember)

I though pointer arithmetic was faster - but I guess with todays
optimizing compilers it won't make a difference.

> 3. where two ending \NUL becomes from ? Should be this function responsible for this, or at least test it ?

The function converts '|' chars into \0 chars. The string itself
contains two || at the end. The function doesn't have to check or even
do it (it can't really do it - appending isn't allowed because that
would cause a buffer overflow).


   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-08-31 21:33:57 CEST

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