diff options
author | rowanbeentje <rowan@beent.je> | 2012-05-10 23:58:12 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-05-10 23:58:12 +0000 |
commit | ddbb9327e4eff680e367df06b1852b93d469f970 (patch) | |
tree | af934accfa7cf65cc858a72fb528ddde3971d7e6 | |
parent | 388a71f4bcb6d89bb0d39bfd3a637e69163fc9e1 (diff) | |
download | sequelpro-ddbb9327e4eff680e367df06b1852b93d469f970.tar.gz sequelpro-ddbb9327e4eff680e367df06b1852b93d469f970.tar.bz2 sequelpro-ddbb9327e4eff680e367df06b1852b93d469f970.zip |
- Iterate over group nodes backwards when removing them during sorting, fixing excpetions if sorting multiple group nodes in a tree
-rw-r--r-- | Source/SPConnectionController.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 9400f451..cc1daeb7 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1160,13 +1160,13 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, } } - NSUInteger i = [indexes firstIndex]; + NSUInteger i = [indexes lastIndex]; while (i != NSNotFound) { [nodes removeObjectAtIndex:i]; - i = [indexes indexGreaterThanIndex:i]; + i = [indexes indexLessThanIndex:i]; } [indexes release]; |