no longer allow duplicate hosts

This commit is contained in:
Diego Waxemberg committed 2014-11-27 13:56:39 -05:00
1 parent 427e8f67fc
commit e913d26ca6
2 files changed
+19 -1

No files matched your search

+16
View File
@@ -28,4 +28,20 @@
return self;
}
- (BOOL)isEqual:(id)object {
if ([object isKindOfClass:[Computer class]]) {
return [self.hostName isEqual:[object valueForKey:@"hostName"]];
} else {
return NO;
}
}
- (NSUInteger)hash {
NSUInteger prime = 31;
NSUInteger result = 1;
result = prime * result + (self.hostName == nil ? 0 : [self.hostName hash]);
return result;
}
@end