simplify determining selected rows

This commit is contained in:
Mitchell Livingston 2008-01-23 18:25:05 +00:00
parent 30531d75c9
commit 381a5bf4b5
1 changed files with 1 additions and 18 deletions

View File

@ -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];
}