Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -962,15 +962,6 @@ if (_position < _count) return [_array objectAtIndex: _position++]; return nil; } - -- (void)reset -{ - if (_mutationsPtr != NULL && *_mutationsPtr != _mutations) - @throw [OFEnumerationMutationException - exceptionWithObject: _array]; - - _position = 0; -} @end Index: src/OFDNSResolver.m ================================================================== --- src/OFDNSResolver.m +++ src/OFDNSResolver.m @@ -1588,12 +1588,12 @@ #endif - (void)of_reloadSystemConfig { /* - * TODO: Rather than reparsing every, check what actually changed - * (mtime) and only reset those. + * TODO: Rather than reparsing every time, check what actually changed + * (mtime) and only reset those. */ if (_lastConfigReload != nil && _configReloadInterval > 0 && _lastConfigReload.timeIntervalSinceNow < _configReloadInterval) return; Index: src/OFEnumerator.h ================================================================== --- src/OFEnumerator.h +++ src/OFEnumerator.h @@ -57,16 +57,10 @@ * @brief Returns an array of all remaining objects in the collection. * * @return An array of all remaining objects in the collection. */ - (OFArray OF_GENERIC(ObjectType) *)allObjects; - -/*! - * @brief Resets the enumerator, so the next call to nextObject returns the - * first object again. - */ -- (void)reset; #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif @end Index: src/OFEnumerator.m ================================================================== --- src/OFEnumerator.m +++ src/OFEnumerator.m @@ -56,11 +56,6 @@ objc_autoreleasePoolPop(pool); return ret; } - -- (void)reset -{ - OF_UNRECOGNIZED_SELECTOR -} @end Index: src/OFList.m ================================================================== --- src/OFList.m +++ src/OFList.m @@ -443,15 +443,6 @@ ret = _current->object; _current = _current->next; return ret; } - -- (void)reset -{ - if (*_mutationsPtr != _mutations) - @throw [OFEnumerationMutationException - exceptionWithObject: _list]; - - _current = _list.firstListObject; -} @end Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -253,14 +253,8 @@ * finished. * * @return The next object */ - (void *_Nullable *_Nullable)nextObject; - -/*! - * @brief Resets the enumerator, so the next call to @ref nextObject returns the - * first object again. - */ -- (void)reset; @end OF_ASSUME_NONNULL_END Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -679,19 +679,10 @@ - (void **)nextObject { OF_UNRECOGNIZED_SELECTOR } - -- (void)reset -{ - if (*_mutationsPtr != _mutations) - @throw [OFEnumerationMutationException - exceptionWithObject: _mapTable]; - - _position = 0; -} @end @implementation OFMapTableKeyEnumerator - (void **)nextObject { @@ -760,16 +751,6 @@ exceptionWithObject: _object]; } return (id)*objectPtr; } - -- (void)reset -{ - @try { - [_enumerator reset]; - } @catch (OFEnumerationMutationException *e) { - @throw [OFEnumerationMutationException - exceptionWithObject: _object]; - } -} @end Index: tests/OFArrayTests.m ================================================================== --- tests/OFArrayTests.m +++ tests/OFArrayTests.m @@ -292,11 +292,10 @@ if (m[0].count != i) ok = false; TEST(@"OFEnumerator's -[nextObject]", ok) - [enumerator reset]; [m[0] removeObjectAtIndex: 0]; EXPECT_EXCEPTION(@"Detection of mutation during enumeration", OFEnumerationMutationException, [enumerator nextObject]) Index: tests/OFDictionaryTests.m ================================================================== --- tests/OFDictionaryTests.m +++ tests/OFDictionaryTests.m @@ -220,11 +220,10 @@ [[keyEnumerator nextObject] isEqual: keys[1]] && [[objectEnumerator nextObject] isEqual: values[1]] && [keyEnumerator nextObject] == nil && [objectEnumerator nextObject] == nil) - [keyEnumerator reset]; [mutDict removeObjectForKey: keys[0]]; EXPECT_EXCEPTION(@"Detection of mutation during enumeration", OFEnumerationMutationException, [keyEnumerator nextObject]); Index: tests/OFListTests.m ================================================================== --- tests/OFListTests.m +++ tests/OFListTests.m @@ -107,11 +107,10 @@ if (list.count != i) ok = false; TEST(@"OFEnumerator's -[nextObject]", ok); - [enumerator reset]; [list removeListObject: list.firstListObject]; EXPECT_EXCEPTION(@"Detection of mutation during enumeration", OFEnumerationMutationException, [enumerator nextObject])