swift - Complexity Analysis of Structs and Enums -
does know complexity initialize struct or enum?
or, know of 3 costs least amount of time/resources allocate memory for?
in situation, i'm using struct/enum house variables me reference later. example, here's equivalent struct/enum:
using struct:
struct identifier { static let key = "a long string dictionary key, shortened using struct." } let dictionaryitem = adictionary[identifier.key]
now using enums:
enum identifier: string { case key = "a long string dictionary key, shortened using enum." } let dictionaryitem = adictionary[identifier.key.rawvalue]
which faster? more effi
Comments
Post a Comment