I appreciate your issue was with the "duplication" of the code, but is
there also not a performance issue with the second function call?

   Result := CheckNumber(GetUnicodeCategory(S, Index))

should it not be

   Result := CheckNumber(InternalGetUnicodeCategory(UCS4Char(C)))

?


On Sun, Jun 3, 2012 at 9:45 AM, Todd <[email protected]> wrote:

> Is this a representative example of the code quality Embarcadero is
> producing today?
>
> class function TCharacter.IsNumber(C: Char): Boolean;
> begin
>  if not IsLatin1(C) then
>    Result := CheckNumber(InternalGetUnicodeCategory(UCS4Char(C)))
>  else if not IsAscii(C) then
>    Result := CheckNumber(InternalGetLatin1Category(C))
>  else
>    Result := (C >= '0') and (C <= '9');
> end;
>
> class function TCharacter.IsNumber(const S: string; Index: Integer):
> Boolean;
> var
>  C: Char;
> begin
>  CheckStringRange(S, Index);
>  C := S[Index];
>  if not IsLatin1(C) then
>    Result := CheckNumber(GetUnicodeCategory(S, Index))
>  else if not IsAscii(C) then
>    Result := CheckNumber(InternalGetLatin1Category(C))
>  else
>    Result := (C >= '0') and (C <= '9');
> end;
>
> Todd.
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: [email protected]
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to [email protected] with
> Subject: unsubscribe
>



-- 
Regards,
Pawel Rewak
Acumen Data
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to