aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseData.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2014-12-13 19:48:41 +0100
committerMax <post@wickenrode.com>2014-12-13 19:48:41 +0100
commit3b251b8e3d4dc9a694ef76562b388ab07da54785 (patch)
tree8ce5a4c4c637bab883ed7e6667bff7b5b74adbc3 /Source/SPDatabaseData.m
parent876dde21d97897ad4ee98aa0d6b11898282982ce (diff)
downloadsequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.tar.gz
sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.tar.bz2
sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.zip
Replace some NSDictionaries with literals
* [NSDictionary dictionary] → @{} * [NSDictionary dictionaryWithObject:forKey:] can safely be replaced. object==nil would have already thrown a NPE in the past. * Also replaced some (hopefully safe) NSArray initializers (ie. their objects should always exist).
Diffstat (limited to 'Source/SPDatabaseData.m')
-rw-r--r--Source/SPDatabaseData.m18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/SPDatabaseData.m b/Source/SPDatabaseData.m
index 1bd9a8f9..58ffa2d2 100644
--- a/Source/SPDatabaseData.m
+++ b/Source/SPDatabaseData.m
@@ -167,7 +167,7 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo,
NSString *charSet = [NSString stringWithCString:c->name encoding:NSUTF8StringEncoding];
if ([charSet isEqualToString:characterSetEncoding]) {
- [characterSetCollations addObject:[NSDictionary dictionaryWithObject:[NSString stringWithCString:c->collation encoding:NSUTF8StringEncoding] forKey:@"COLLATION_NAME"]];
+ [characterSetCollations addObject:@{@"COLLATION_NAME" : [NSString stringWithCString:c->collation encoding:NSUTF8StringEncoding]}];
}
++c;
@@ -191,36 +191,36 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo,
{
if ([storageEngines count] == 0) {
if ([serverSupport isMySQL3] || [serverSupport isMySQL4]) {
- [storageEngines addObject:[NSDictionary dictionaryWithObject:@"MyISAM" forKey:@"Engine"]];
+ [storageEngines addObject:@{@"Engine" : @"MyISAM"}];
// Check if InnoDB support is enabled
NSString *result = [self _getSingleVariableValue:@"have_innodb"];
if(result && [result isEqualToString:@"YES"])
- [storageEngines addObject:[NSDictionary dictionaryWithObject:@"InnoDB" forKey:@"Engine"]];
+ [storageEngines addObject:@{@"Engine" : @"InnoDB"}];
// Before MySQL 4.1 the MEMORY engine was known as HEAP and the ISAM engine was included
if ([serverSupport supportsPre41StorageEngines]) {
- [storageEngines addObject:[NSDictionary dictionaryWithObject:@"HEAP" forKey:@"Engine"]];
- [storageEngines addObject:[NSDictionary dictionaryWithObject:@"ISAM" forKey:@"Engine"]];
+ [storageEngines addObject:@{@"Engine" : @"HEAP"}];
+ [storageEngines addObject:@{@"Engine" : @"ISAM"}];
}
else {
- [storageEngines addObject:[NSDictionary dictionaryWithObject:@"MEMORY" forKey:@"Engine"]];
+ [storageEngines addObject:@{@"Engine" : @"MEMORY"}];
}
// BLACKHOLE storage engine was added in MySQL 4.1.11
if ([serverSupport supportsBlackholeStorageEngine]) {
- [storageEngines addObject:[NSDictionary dictionaryWithObject:@"BLACKHOLE" forKey:@"Engine"]];
+ [storageEngines addObject:@{@"Engine" : @"BLACKHOLE"}];
}
// ARCHIVE storage engine was added in MySQL 4.1.3
if ([serverSupport supportsArchiveStorageEngine]) {
- [storageEngines addObject:[NSDictionary dictionaryWithObject:@"ARCHIVE" forKey:@"Engine"]];
+ [storageEngines addObject:@{@"Engine" : @"ARCHIVE"}];
}
// CSV storage engine was added in MySQL 4.1.4
if ([serverSupport supportsCSVStorageEngine]) {
- [storageEngines addObject:[NSDictionary dictionaryWithObject:@"CSV" forKey:@"Engine"]];
+ [storageEngines addObject:@{@"Engine" : @"CSV"}];
}
}
// The table information_schema.engines didn't exist until MySQL 5.1.5