From 381a5bf4b5982d7058077825848b3641918e4e2a Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Wed, 23 Jan 2008 18:25:05 +0000 Subject: [PATCH] simplify determining selected rows --- macosx/TorrentTableView.m | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index c26dcf45c..c4d128de1 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -282,7 +282,6 @@ else; } -#warning better way? - use group indexes - (void) selectValues: (NSArray *) values { id object; @@ -290,23 +289,7 @@ NSMutableIndexSet * indexSet = [[NSMutableIndexSet alloc] init]; while ((object = [enumerator nextObject])) { - unsigned index = NSNotFound; - if ([object isKindOfClass: [Torrent class]]) - index = [fTorrents indexOfObject: object]; - else - { - int value = [object intValue]; - unsigned i; - for (i = 0; i < [fTorrents count]; i++) - { - if ([fGroupIndexes containsIndex: i] && value == [[fTorrents objectAtIndex: i] intValue]) - { - index = i; - break; - } - } - } - + unsigned index = [fTorrents indexOfObject: object]; //works with torrents and groups if (index != NSNotFound) [indexSet addIndex: index]; }