mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-10-22 08:07:22 +00:00
Implement hash and isEqual for TemporaryApp and TemporaryHost
This commit is contained in:
1 parent
1c1f22e047
commit
ec3748b26e
2 files changed
+32
No files matched your search
@@ -33,4 +33,20 @@
|
||||
return [self.name caseInsensitiveCompare:other.name];
|
||||
}
|
||||
|
||||
- (NSUInteger)hash {
|
||||
return [self.id intValue];
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object {
|
||||
if (self == object) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
if (![object isKindOfClass:[App class]]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [self.id isEqualToString:((App*)object).id];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -67,4 +67,20 @@
|
||||
return [self.name caseInsensitiveCompare:other.name];
|
||||
}
|
||||
|
||||
- (NSUInteger)hash {
|
||||
return [self.uuid hash];
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object {
|
||||
if (self == object) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
if (![object isKindOfClass:[Host class]]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return [self.uuid isEqualToString:((Host*)object).uuid];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user