EvgenyKarkan / EKAlgorithms

EKAlgorithms contains some well known CS algorithms & data structures.
MIT License
2.42k stars 362 forks source link

[Question]Some code style? function question? #107

Closed cool8jay closed 7 years ago

cool8jay commented 7 years ago

Hi,

In EKGraph.m, I see code like this

NSMutableArray *parent = [@[] mutableCopy];
NSMutableDictionary *dist     = [@{} mutableCopy];

why not

NSMutableArray *parent = [NSMutableArray array];
NSMutableDictionary *dist     = [NSMutableDictionary dictionary];

Is this kind of code relative to special function or just a way of style?

cool8jay commented 7 years ago

I find an explanation here.

http://stackoverflow.com/questions/13607007/what-is-and-in-objective-c