| // Created by Justin Spahr-Summers on 2012-10-29. |
| // Copyright (c) 2012 GitHub. All rights reserved. |
| #import "RACEmptySequence.h" |
| @implementation RACEmptySequence |
| static dispatch_once_t pred; |
| singleton = [[self alloc] init]; |
| - (RACSequence *)bind:(RACStreamBindBlock)bindBlock passingThroughValuesFromSequence:(RACSequence *)passthroughSequence { |
| return passthroughSequence ?: self; |
| // Empty sequences should be encoded as themselves, not array sequences. |
| - (id)initWithCoder:(NSCoder *)coder { |
| - (void)encodeWithCoder:(NSCoder *)coder { |
| - (NSString *)description { |
| return [NSString stringWithFormat:@"<%@: %p>{ name = %@ }", self.class, self, self.name]; |
| // This hash isn't ideal, but it's better than -[RACSequence hash], which |
| // would just be zero because we have no head. |
| return (NSUInteger)(__bridge void *)self; |
| - (BOOL)isEqual:(RACSequence *)seq { |