From 2ff722a0de334e4fc4df1dc6219734e85326637c Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 19 May 2009 19:47:40 +0000 Subject: =?UTF-8?q?=E2=80=A2=20some=20minor=20code=20cosmetics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableDump.m | 13 ++++++++----- 1 file 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]]; } -- cgit v1.2.3