diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-08-20 10:02:00 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-08-20 10:02:00 +0000 |
commit | d17a6b638e529694685a333162bbf6fec6c7fc08 (patch) | |
tree | 5c72506af7bf75299c093ce6a47b7cc4a956e0ff /Source/SPUserManager.m | |
parent | dabf6466f11e5936ee871b8b3dd573020a142586 (diff) | |
download | sequelpro-d17a6b638e529694685a333162bbf6fec6c7fc08.tar.gz sequelpro-d17a6b638e529694685a333162bbf6fec6c7fc08.tar.bz2 sequelpro-d17a6b638e529694685a333162bbf6fec6c7fc08.zip |
• overall replacement of:
[aString appendString:[NSString stringWithFormat:]] by
[aString appendFormat:]
since it's much more faster
• first look at loop where several [aStr appendString:] occur to try to combine them into one appendString or appendFormat since the allocation of memory takes really time
Note: I tested all my changes but we should test it further to be sure that I didn't a mistake!
Diffstat (limited to 'Source/SPUserManager.m')
-rw-r--r-- | Source/SPUserManager.m | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 8bd1f687..5f692c68 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -997,21 +997,21 @@ for (NSManagedObject *user in deletedUsers) { - if (![[[user entity] name] isEqualToString:@"Privileges"] && [user valueForKey:@"host"] != nil) + if (![[[user entity] name] isEqualToString:@"Privileges"] && [user valueForKey:@"host"] != nil) { - [droppedUsers appendString:[NSString stringWithFormat:@"%@@%@, ", - [[user valueForKey:@"user"] tickQuotedString], - [[user valueForKey:@"host"] tickQuotedString]]]; + [droppedUsers appendFormat:@"%@@%@, ", + [[user valueForKey:@"user"] tickQuotedString], + [[user valueForKey:@"host"] tickQuotedString]]; } - + + } + + if ([droppedUsers length] > 2) { + droppedUsers = [[droppedUsers substringToIndex:[droppedUsers length]-2] mutableCopy]; + [self.mySqlConnection queryString:[NSString stringWithFormat:@"DROP USER %@", droppedUsers]]; + [droppedUsers release]; } - if ([droppedUsers length] > 2) { - droppedUsers = [[droppedUsers substringToIndex:[droppedUsers length]-2] mutableCopy]; - [self.mySqlConnection queryString:[NSString stringWithFormat:@"DROP USER %@", droppedUsers]]; - [droppedUsers release]; - } - return TRUE; } |