mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Minor api consistency improvement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12645 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
59bdeabe4b
commit
7bd047b3b1
4 changed files with 17 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
|||
2002-02-22 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Headers/gnustep/base/NSArray.h: insertion position api update.
|
||||
* Source/NSArray.m: insertion position api update.
|
||||
* Source/GSArray.m: insertion position api update.
|
||||
Make insertion position api consistent with sorting api.
|
||||
|
||||
2002-02-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSValue.m: Fixed bug in archiving NSValue objects ... was
|
||||
|
|
|
@ -148,7 +148,8 @@
|
|||
* the reciever is 'less than' the item in the array.
|
||||
*/
|
||||
- (unsigned) insertionPosition: (id)item
|
||||
usingFunction: (NSComparisonResult (*)(id, id))sorter;
|
||||
usingFunction: (NSComparisonResult (*)(id, id, void *))sorter
|
||||
context: (void *)context;
|
||||
- (unsigned) insertionPosition: (id)item
|
||||
usingSelector: (SEL)comp;
|
||||
@end
|
||||
|
|
|
@ -739,7 +739,8 @@ static SEL eqSel;
|
|||
* if it is greater, and NSOrderedSame if it is equal.
|
||||
*/
|
||||
- (unsigned) insertionPosition: (id)item
|
||||
usingFunction: (NSComparisonResult (*)(id, id))sorter
|
||||
usingFunction: (NSComparisonResult (*)(id, id, void *))sorter
|
||||
context: (void *)context
|
||||
{
|
||||
unsigned upper = _count;
|
||||
unsigned lower = 0;
|
||||
|
@ -763,7 +764,7 @@ static SEL eqSel;
|
|||
{
|
||||
NSComparisonResult comparison;
|
||||
|
||||
comparison = (*sorter)(item, _contents_array[index]);
|
||||
comparison = (*sorter)(item, _contents_array[index], context);
|
||||
if (comparison == NSOrderedAscending)
|
||||
{
|
||||
upper = index;
|
||||
|
@ -782,7 +783,7 @@ static SEL eqSel;
|
|||
* items that are equal to the new one.
|
||||
*/
|
||||
while (index < _count
|
||||
&& (*sorter)(item, _contents_array[index]) != NSOrderedAscending)
|
||||
&& (*sorter)(item, _contents_array[index], context) != NSOrderedAscending)
|
||||
{
|
||||
index++;
|
||||
}
|
||||
|
|
|
@ -1472,7 +1472,8 @@ static NSString *indentStrings[] = {
|
|||
* if it is greater, and NSOrderedSame if it is equal.
|
||||
*/
|
||||
- (unsigned) insertionPosition: (id)item
|
||||
usingFunction: (NSComparisonResult (*)(id, id))sorter
|
||||
usingFunction: (NSComparisonResult (*)(id, id, void *))sorter
|
||||
context: (void *)context
|
||||
{
|
||||
unsigned count = [self count];
|
||||
unsigned upper = count;
|
||||
|
@ -1499,7 +1500,7 @@ static NSString *indentStrings[] = {
|
|||
{
|
||||
NSComparisonResult comparison;
|
||||
|
||||
comparison = (*sorter)(item, (*oai)(self, oaiSel, index));
|
||||
comparison = (*sorter)(item, (*oai)(self, oaiSel, index), context);
|
||||
if (comparison == NSOrderedAscending)
|
||||
{
|
||||
upper = index;
|
||||
|
@ -1518,7 +1519,7 @@ static NSString *indentStrings[] = {
|
|||
* items that are equal to the new one.
|
||||
*/
|
||||
while (index < count
|
||||
&& (*sorter)(item, (*oai)(self, oaiSel, index)) != NSOrderedAscending)
|
||||
&& (*sorter)(item, (*oai)(self, oaiSel, index), context) != NSOrderedAscending)
|
||||
{
|
||||
index++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue