+2008-03-11 Helge Hess <helge.hess@opengroupware.org>
+
+ * FdExt.subproj/NSArray+enumerator.m: fixed for MacOS 10.5 (v4.7.201)
+
2008-02-21 Helge Hess <helge.hess@opengroupware.org>
* FdExt.subproj/NSString+Escaping.m: fixed a free() bug introduced in
/*
- Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2000-2008 SKYRIX Software AG
+ Copyright (C) 2008 Helge Hess
This file is part of SOPE.
@implementation NSMutableArray(enumerator)
- (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator {
- if ((self = [self init])) {
+#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
+ NSMutableArray *ma = [[NSMutableArray alloc] initWithCapacity:64];
+ id obj;
+
+ while ((obj = [_enumerator nextObject]))
+ [ma addObject:obj];
+
+ self = [self initWithArray:ma];
+ [ma release]; ma = nil;
+ return self;
+#else
+ if ((self = [self init]) != nil) {
id obj = nil;
+ // Does not work on Cocoa because we only have NSCFArray over there ...
while ((obj = [_enumerator nextObject]))
[self addObject:obj];
}
return self;
+#endif
}
@end /* NSMutableArray(enumerator) */