[Sparkle] SUGetCharType for double zeroes

Andy Matuschak andy at andymatuschak.org
Mon Jul 9 10:32:46 PDT 2007


I am generally dissatisfied with the version comparison algorithm: it  
seems rather brittle. This should definitely be implemented with  
NSCharacterSet, though.

http://sparkle.andymatuschak.org/ticket/30

- Andy Matuschak

On Jul 9, 2007, at 9:36 AM, Dave Dribin wrote:

> Hello,
>
> I've noticed that SUGetCharType() returns a string type for multiple
> zeroes, like "00".  The current code is:
>
> int SUGetCharType(NSString *character)
> {
>     if ([character isEqualToString:@"."]) {
>         return kPeriodType;
>     } else if ([character isEqualToString:@"0"] || [character
> intValue] != 0) {
>         return kNumberType;
>     } else {
>         return kStringType;
>     }	
> }
>
>
> Can anyone think of a reason why not to use +[NSCharacterSet
> decimalDigitCharacterSet] to match kNumberType?  I'm changing my
> version numbers to not use multiple zeroes, but figured this may be a
> worthy patch to Sparkle to help someone else in the future.
>
> Thanks,
>
> -Dave
>
> _______________________________________________
> Sparkle mailing list
> Sparkle at lists.andymatuschak.org
> http://lists.andymatuschak.org/listinfo.cgi/sparkle-andymatuschak.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andymatuschak.org/private.cgi/sparkle-andymatuschak.org/attachments/20070709/b88b29cc/attachment.htm 


More information about the Sparkle mailing list