mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-06 15:08:50 +00:00
Summary: A quick push to fix something I noticed while studying how IGListKit works. This simply replaces "Facebook, Inc" with "Meta Platforms, Inc" in all of the source files where the company copyright notice is posted. This should help bring our external facing projects more in line with our new corporate branding. There's still a lot more references to "Facebook" as a company in the library (especially around linking to other Meta sponsored open source libraries), but this might need additional scrutiny and review on a case-by-case basis, so let's handle those ones separately. Reviewed By: lorixx Differential Revision: D41207363 fbshipit-source-id: 57cdbf5eb1023b41a5f32c0c05e01628686a19fe
82 lines
2.1 KiB
Objective-C
82 lines
2.1 KiB
Objective-C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
/**
|
|
* This file is generated using the remodel generation script.
|
|
* The name of the input file is PersonModel.value
|
|
*/
|
|
|
|
#if ! __has_feature(objc_arc)
|
|
#error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
|
#endif
|
|
|
|
#import "PersonModel.h"
|
|
|
|
@implementation PersonModel
|
|
|
|
- (instancetype)initWithFirstName:(NSString *)firstName lastName:(NSString *)lastName uniqueId:(NSString *)uniqueId
|
|
{
|
|
if ((self = [super init])) {
|
|
_firstName = [firstName copy];
|
|
_lastName = [lastName copy];
|
|
_uniqueId = [uniqueId copy];
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
- (id)copyWithZone:(nullable NSZone *)zone
|
|
{
|
|
return self;
|
|
}
|
|
|
|
- (NSString *)description
|
|
{
|
|
return [NSString stringWithFormat:@"%@ - \n\t firstName: %@; \n\t lastName: %@; \n\t uniqueId: %@; \n", [super description], _firstName, _lastName, _uniqueId];
|
|
}
|
|
|
|
- (id<NSObject>)diffIdentifier
|
|
{
|
|
return _uniqueId;
|
|
}
|
|
|
|
- (NSUInteger)hash
|
|
{
|
|
NSUInteger subhashes[] = {[_firstName hash], [_lastName hash], [_uniqueId hash]};
|
|
NSUInteger result = subhashes[0];
|
|
for (int ii = 1; ii < 3; ++ii) {
|
|
unsigned long long base = (((unsigned long long)result) << 32 | subhashes[ii]);
|
|
base = (~base) + (base << 18);
|
|
base ^= (base >> 31);
|
|
base *= 21;
|
|
base ^= (base >> 11);
|
|
base += (base << 6);
|
|
base ^= (base >> 22);
|
|
result = base;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
- (BOOL)isEqual:(PersonModel *)object
|
|
{
|
|
if (self == object) {
|
|
return YES;
|
|
} else if (self == nil || object == nil || ![object isKindOfClass:[self class]]) {
|
|
return NO;
|
|
}
|
|
return
|
|
(_firstName == object->_firstName ? YES : [_firstName isEqual:object->_firstName]) &&
|
|
(_lastName == object->_lastName ? YES : [_lastName isEqual:object->_lastName]) &&
|
|
(_uniqueId == object->_uniqueId ? YES : [_uniqueId isEqual:object->_uniqueId]);
|
|
}
|
|
|
|
- (BOOL)isEqualToDiffableObject:(nullable id<IGListDiffable>)object
|
|
{
|
|
return [self isEqual:object];
|
|
}
|
|
|
|
@end
|