mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
optimisation and compatiblity tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38524 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
507deac980
commit
6297efeec9
3 changed files with 18 additions and 9 deletions
|
@ -287,7 +287,7 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
|
||||
- (NSMutableSet*) mutableSetValueForKeyPath: (NSString*)aKey
|
||||
{
|
||||
NSRange r = [aKey rangeOfString: @"."];
|
||||
NSRange r = [aKey rangeOfString: @"." options: NSLiteralSearch];
|
||||
|
||||
if (r.length == 0)
|
||||
{
|
||||
|
@ -309,7 +309,7 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
|
||||
- (NSMutableArray*) mutableArrayValueForKeyPath: (NSString*)aKey
|
||||
{
|
||||
NSRange r = [aKey rangeOfString: @"."];
|
||||
NSRange r = [aKey rangeOfString: @"." options: NSLiteralSearch];
|
||||
|
||||
if (r.length == 0)
|
||||
{
|
||||
|
@ -373,7 +373,7 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
|
||||
- (void) setValue: (id)anObject forKeyPath: (NSString*)aKey
|
||||
{
|
||||
NSRange r = [aKey rangeOfString: @"."];
|
||||
NSRange r = [aKey rangeOfString: @"." options: NSLiteralSearch];
|
||||
#ifdef WANT_DEPRECATED_KVC_COMPAT
|
||||
IMP o = [self methodForSelector: @selector(takeValue:forKeyPath:)];
|
||||
|
||||
|
@ -499,7 +499,7 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
forKeyPath: (NSString*)aKey
|
||||
error: (NSError**)anError
|
||||
{
|
||||
NSRange r = [aKey rangeOfString: @"."];
|
||||
NSRange r = [aKey rangeOfString: @"." options: NSLiteralSearch];
|
||||
|
||||
if (r.length == 0)
|
||||
{
|
||||
|
@ -532,7 +532,7 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
|
||||
- (id) valueForKeyPath: (NSString*)aKey
|
||||
{
|
||||
NSRange r = [aKey rangeOfString: @"."];
|
||||
NSRange r = [aKey rangeOfString: @"." options: NSLiteralSearch];
|
||||
|
||||
if (r.length == 0)
|
||||
{
|
||||
|
@ -858,7 +858,7 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
|
||||
- (void) takeValue: (id)anObject forKeyPath: (NSString*)aKey
|
||||
{
|
||||
NSRange r = [aKey rangeOfString: @"."];
|
||||
NSRange r = [aKey rangeOfString: @"." options: NSLiteralSearch];
|
||||
|
||||
GSOnceMLog(@"This method is deprecated, use -setValue:forKeyPath:");
|
||||
if (r.length == 0)
|
||||
|
|
|
@ -2532,7 +2532,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
}
|
||||
|
||||
- (NSUInteger) indexOfString: (NSString*)substring
|
||||
fromIndex: (NSUInteger)index
|
||||
fromIndex: (NSUInteger)index
|
||||
{
|
||||
NSRange range = {index, [self length] - index};
|
||||
|
||||
|
@ -2638,9 +2638,10 @@ static BOOL (*nbImp)(id, SEL, unichar) = 0;
|
|||
- (BOOL) hasPrefix: (NSString*)aString
|
||||
{
|
||||
NSRange range = NSMakeRange(0, [self length]);
|
||||
NSUInteger mask = NSLiteralSearch | NSAnchoredSearch;
|
||||
|
||||
range = [self rangeOfString: aString
|
||||
options: NSAnchoredSearch
|
||||
options: mask
|
||||
range: range
|
||||
locale: nil];
|
||||
return (range.length > 0) ? YES : NO;
|
||||
|
@ -2652,9 +2653,10 @@ static BOOL (*nbImp)(id, SEL, unichar) = 0;
|
|||
- (BOOL) hasSuffix: (NSString*)aString
|
||||
{
|
||||
NSRange range = NSMakeRange(0, [self length]);
|
||||
NSUInteger mask = NSLiteralSearch | NSAnchoredSearch | NSBackwardsSearch;
|
||||
|
||||
range = [self rangeOfString: aString
|
||||
options: NSAnchoredSearch | NSBackwardsSearch
|
||||
options: mask
|
||||
range: range
|
||||
locale: nil];
|
||||
return (range.length > 0) ? YES : NO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue