Skip to content

Commit

Permalink
Dictionary access using subscript
Browse files Browse the repository at this point in the history
  • Loading branch information
specious committed Dec 31, 2017
1 parent f43496c commit ceda559
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

for (int i = 0; i < [handlers count]; i++) {
NSString *handler = [handlers objectAtIndex:i];
[dict setObject:handler forKey:[app_name_from_bundle_id(handler) lowercaseString]];
dict[[app_name_from_bundle_id(handler) lowercaseString]] = handler;
}

return dict;
Expand Down Expand Up @@ -64,7 +64,7 @@ int main(int argc, const char *argv[]) {
if ([target_handler_name isEqual:current_handler_name]) {
printf("%s is already set as the default HTTP handler\n", target);
} else {
NSString *target_handler = [handlers valueForKey:target_handler_name];
NSString *target_handler = handlers[target_handler_name];

if (target_handler != nil) {
// Set new HTTP handler (HTTP and HTTPS separately)
Expand Down

0 comments on commit ceda559

Please sign in to comment.