ftp.nice.ch/pub/next/connectivity/filetransfer/Yftp.0.564.NIHS.bs.tar.gz#/Yftp/Yftp.0.564/SortedList.m

This is SortedList.m in view mode; [Download] [Up]

#import "SortedList.h"

@implementation SortedList

- addObjectSorted:anObject;
{
	id otherObject;
	int i=0;
	
	while(TRUE)
	{
		otherObject = [self objectAt:i];

		if (!otherObject)
			return [self addObject:anObject];

		if ([anObject compareWith:otherObject] < 0)
			return [self insertObject:anObject at:i];
		
		i++;
	}
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.