开发者

iPhone NSDictionary objectForKey: vs valueForKey: performance

开发者 https://www.devze.com 2023-01-16 21:36 出处:网络
In a code base I work with method valueForKey: is often used instead of objectForKey:. I have to optimize few methods that does this and was thinking if changing this to 开发者_JS百科objectForKey: wil

In a code base I work with method valueForKey: is often used instead of objectForKey:. I have to optimize few methods that does this and was thinking if changing this to 开发者_JS百科objectForKey: will introduce some performance gains?


For NSDictionary i would use objectForKey:..

valueForKey: redirects to objectForKey if the key does not start with @ and calls [super valueForKey:] if it does..

using find & replace you can change to objectForKey pretty fast so why not, but i doubt you will notice any difference at all!

0

精彩评论

暂无评论...
验证码 换一张
取 消