[libr] Initialize SetIterator the right way

I'd written Set.[rh] after the big rewrite so never noticed the access
error.
This commit is contained in:
Bill Currie 2020-03-03 10:43:29 +09:00
parent 16223098e5
commit c2138183dd

View file

@ -27,6 +27,15 @@ string set_as_string (set_t *set) = #0;
@implementation SetIterator: Object
- initWithIterator: (set_iter_t *) iter
{
if (!(self = [super init])) {
return nil;
}
self.iter = iter;
return self;
}
- (SetIterator *) next
{
if ((iter = set_next (iter)))
@ -84,8 +93,7 @@ string set_as_string (set_t *set) = #0;
if (!iter)
return nil;
iterator = [[SetIterator alloc] init];
iterator.iter = iter;
iterator = [[SetIterator alloc] initWithIterator: iter];
return iterator;
}