Re: [PATCH v2] correct verify_path for Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/10/11 Dmitry Potapov <dpotapov@xxxxxxxxx>:
>> > +   /* On Windows, file names are case-insensitive */
>> > +   case 'G':
>> > +           if ((rest[1]|0x20) != 'i')
>> > +                   break;
>> > +           if ((rest[2]|0x20) != 't')
>> > +                   break;
>>
>> We have tolower().
>
> I am aware of that, but I am not sure what we gain by using it. It seems
> it makes only code bigger and slow.

It does? Care to look into git-compat-util.h?

> ... As to readability, I don't see much
> improvement... Isn't obvious what this code does, especially with the
> above comment?

You want to seriously argue that "a | 0x20" is as readable as "tolower(a)"?
For the years to come? With a person who does not even know what ASCII is?
Ok, I'm exaggerating. But the point is: it is not us who will be
reading the code.
And even if they do this just to remove Windows quirks it is well worth to
use a bit more of english language so that they don't need a second look.
As to comment: it is just additional info. It can't be checked by compiler
if you make and accidental typo in your code (like, for example, accidentally
putting an extra pipe in that expression, should happen to that emacs users
from time to time).

BTW, is it such a critical path? Can't the code be unified and do
without #ifdef?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux