mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Added enumeration mutation function, called by code automatically inserted by the compiler when a collection mutates during fast enumeration.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28610 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
271a54ece9
commit
b29e4570e7
2 changed files with 17 additions and 0 deletions
|
@ -29,6 +29,8 @@
|
|||
#import "GNUstepBase/preface.h"
|
||||
#import "Foundation/NSArray.h"
|
||||
#import "Foundation/NSEnumerator.h"
|
||||
#include "Foundation/NSException.h"
|
||||
|
||||
|
||||
/**
|
||||
* Simple class for iterating over a collection of objects, usually returned
|
||||
|
@ -96,3 +98,14 @@
|
|||
return len;
|
||||
}
|
||||
@end
|
||||
|
||||
/**
|
||||
* objc_enumerationMutation() is called whenever a collection mutates in the
|
||||
* middle of fast enumeration.
|
||||
*/
|
||||
void objc_enumerationMutation(id obj)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"Collection %@ was mutated while being enumerated",
|
||||
obj];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue