From 212ec30187def16228a973321038bda19585e48f Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 16 Jan 2007 03:32:09 +0000 Subject: [PATCH] one less initialization --- macosx/Controller.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index da72d833a..d4ede2686 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1000,7 +1000,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy while ((torrent = [enumerator nextObject])) [torrent setWaitToStart: NO]; - NSNumber * lowestOrderValue = [NSNumber numberWithInt: [torrents count]], * currentOrderValue; + NSNumber * lowestOrderValue = nil, * currentOrderValue; enumerator = [torrents objectEnumerator]; while ((torrent = [enumerator nextObject])) @@ -1014,7 +1014,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy //determine lowest order value currentOrderValue = [torrent orderValue]; - if ([lowestOrderValue compare: currentOrderValue] == NSOrderedDescending) + if (!lowestOrderValue || [lowestOrderValue compare: currentOrderValue] == NSOrderedDescending) lowestOrderValue = currentOrderValue; [fTorrents removeObject: torrent];