1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
|
|
1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2022 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
|
OFMutableArray *ret = [[self mutableCopy] autorelease];
[ret addObjectsFromArray: array];
[ret makeImmutable];
return ret;
}
- (OFArray *)arrayByRemovingObject: (id)object
{
OFMutableArray *ret = [[self mutableCopy] autorelease];
[ret removeObject: object];
[ret makeImmutable];
return ret;
}
#ifdef OF_HAVE_BLOCKS
- (OFArray *)mappedArrayUsingBlock: (OFArrayMapBlock)block
{
OFArray *ret;
size_t count = self.count;
id *tmp = OFAllocMemory(count, sizeof(id));
|
<
<
<
<
<
<
<
<
|
811
812
813
814
815
816
817
818
819
820
821
822
823
824
|
OFMutableArray *ret = [[self mutableCopy] autorelease];
[ret addObjectsFromArray: array];
[ret makeImmutable];
return ret;
}
#ifdef OF_HAVE_BLOCKS
- (OFArray *)mappedArrayUsingBlock: (OFArrayMapBlock)block
{
OFArray *ret;
size_t count = self.count;
id *tmp = OFAllocMemory(count, sizeof(id));
|