Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions Source/GSString.m
Original file line number Diff line number Diff line change
Expand Up @@ -3662,9 +3662,7 @@ - (NSComparisonResult) compare: (NSString*)aString
}
GS_RANGE_CHECK(aRange, _count);
if (aString == nil)
[NSException raise: NSInvalidArgumentException
format: @"[%@ -%@] nil string argument",
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
return NSOrderedDescending;
if (GSObjCIsInstance(aString) == NO)
[NSException raise: NSInvalidArgumentException
format: @"[%@ -%@] not a string argument",
Expand Down Expand Up @@ -4041,9 +4039,7 @@ - (NSComparisonResult) compare: (NSString*)aString
}
GS_RANGE_CHECK(aRange, _count);
if (aString == nil)
[NSException raise: NSInvalidArgumentException
format: @"[%@ -%@] nil string argument",
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
return NSOrderedDescending;
if (GSObjCIsInstance(aString) == NO)
[NSException raise: NSInvalidArgumentException
format: @"[%@ -%@] not a string argument",
Expand Down Expand Up @@ -4497,9 +4493,7 @@ - (NSComparisonResult) compare: (NSString*)aString
}
GS_RANGE_CHECK(aRange, _count);
if (aString == nil)
[NSException raise: NSInvalidArgumentException
format: @"[%@ -%@] nil string argument",
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
return NSOrderedDescending;
if (GSObjCIsInstance(aString) == NO)
[NSException raise: NSInvalidArgumentException
format: @"[%@ -%@] not a string argument",
Expand Down
3 changes: 1 addition & 2 deletions Source/NSDate.m
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ - (NSComparisonResult) compare: (NSDate*)otherDate
}
if (unlikely(otherDate == nil))
{
[NSException raise: NSInvalidArgumentException
format: @"nil argument for compare:"];
return NSOrderedSame;
}

if (IS_CONCRETE_CLASS(otherDate))
Expand Down
3 changes: 1 addition & 2 deletions Source/NSString.m
Original file line number Diff line number Diff line change
Expand Up @@ -5914,8 +5914,7 @@ - (NSComparisonResult) compare: (NSString *)string
GS_RANGE_CHECK(compareRange, [self length]);
if (nil == string)
{
[NSException raise: NSInvalidArgumentException
format: @"compare with nil"];
return NSOrderedDescending;
}

/* A nil locale should trigger POSIX collation (i.e. 'A'-'Z' sort
Expand Down