Minor performance tweak

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@21751 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-09-28 06:20:43 +00:00
parent d62edc6002
commit 65c4b6015f
2 changed files with 14 additions and 9 deletions

View file

@ -1,3 +1,7 @@
2005-09-28 Richard Frith-Macdonald <rfm@gnu.org>
* SQLClient.m: boost performance of quoting a little.
2005-09-26 Richard Frith-Macdonald <rfm@gnu.org>
* SQLClient.h: Clean up caching/timestamps.

View file

@ -978,20 +978,12 @@ static void quoteString(NSMutableString *s)
/**
* For a nil object, we return NULL.
*/
if (obj == nil)
if (obj == nil || obj == null)
{
return @"NULL";
}
else if ([obj isKindOfClass: NSStringClass] == NO)
{
/**
* For a nil or NSNull object, we return NULL.
*/
if ([obj isKindOfClass: [NSNull class]] == YES)
{
return @"NULL";
}
/**
* For a number, we simply convert directly to a string.
*/
@ -1020,6 +1012,15 @@ static void quoteString(NSMutableString *s)
return obj;
}
/**
* Just in case an NSNull subclass has been created by someone.
* The normal NSNull instance should have been handled earlier.
*/
if ([obj isKindOfClass: [NSNull class]] == YES)
{
return @"NULL";
}
/**
* For any other type of data, we just produce a quoted string
* representation of the objects description.