diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-05-19 19:47:40 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-05-19 19:47:40 +0000 |
commit | 2ff722a0de334e4fc4df1dc6219734e85326637c (patch) | |
tree | de8047732671a8ca72ccc8689c89a46551a750a1 | |
parent | 6350ce999b2921b0501e9afc5158ded8dffcd7fd (diff) | |
download | sequelpro-2ff722a0de334e4fc4df1dc6219734e85326637c.tar.gz sequelpro-2ff722a0de334e4fc4df1dc6219734e85326637c.tar.bz2 sequelpro-2ff722a0de334e4fc4df1dc6219734e85326637c.zip |
• some minor code cosmetics
-rw-r--r-- | Source/TableDump.m | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index 42d340e3..2d9b60ca 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -458,18 +458,21 @@ [singleProgressBar stopAnimation:self]; [singleProgressBar setUsesThreadedAnimation:NO]; [singleProgressBar setIndeterminate:NO]; - + + NSCharacterSet *whitespaceAndNewline = [NSCharacterSet whitespaceAndNewlineCharacterSet]; + unsigned long queryCount = [queries count]; + //perform all mysql-queries - for ( i = 0 ; i < [queries count] ; i++ ) { - [singleProgressBar setDoubleValue:((i+1)*100/[queries count])]; + for ( i = 0 ; i < queryCount ; i++ ) { + [singleProgressBar setDoubleValue:((i+1)*100/queryCount)]; [singleProgressBar displayIfNeeded]; // Skip blank or whitespace-only queries to avoid errors - if ([[[queries objectAtIndex:i] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] == 0) + if ([[[queries objectAtIndex:i] stringByTrimmingCharactersInSet:whitespaceAndNewline] length] == 0) continue; if (importSQLAsUTF8) { - [mySQLConnection queryString:[queries objectAtIndex:i] usingEncoding:NSUTF8StringEncoding]; + [mySQLConnection queryString:[queries objectAtIndex:i] usingEncoding:NSUTF8StringEncoding]; } else { [mySQLConnection queryString:[queries objectAtIndex:i]]; } |