@interface Person : NSObject
@property(nonatomic, assign) CGFloat salary;
@end
@implementation Person
- (void)addSalary:(CGFloat)s
{
_salary += s; **//method 1**
self.salary += s; **//method 2**
}
@end
我想知道方法1和2之间哪个更有效?编译器会做一些优化工作以使它们具有相同的性能吗?