mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
Fixups for DO compatibility.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26747 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f4e165a49e
commit
d790d9747f
8 changed files with 197 additions and 17 deletions
|
@ -315,17 +315,33 @@ static SEL rlSel;
|
|||
- (NSArray*) arrayByAddingObjectsFromArray: (NSArray*)anotherArray
|
||||
{
|
||||
id na;
|
||||
unsigned c, l;
|
||||
unsigned c;
|
||||
unsigned l;
|
||||
unsigned e;
|
||||
|
||||
c = [self count];
|
||||
l = [anotherArray count];
|
||||
e = c + l;
|
||||
|
||||
{
|
||||
GS_BEGINIDBUF(objects, c+l);
|
||||
GS_BEGINIDBUF(objects, e);
|
||||
|
||||
[self getObjects: objects];
|
||||
[anotherArray getObjects: &objects[c]];
|
||||
na = [NSArrayClass arrayWithObjects: objects count: c+l];
|
||||
if ([anotherArray isProxy])
|
||||
{
|
||||
unsigned i = c;
|
||||
unsigned j = 0;
|
||||
|
||||
while (i < e)
|
||||
{
|
||||
objects[i++] = [anotherArray objectAtIndex: j++];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[anotherArray getObjects: &objects[c]];
|
||||
}
|
||||
na = [NSArrayClass arrayWithObjects: objects count: e];
|
||||
|
||||
GS_ENDIDBUF();
|
||||
}
|
||||
|
@ -582,7 +598,19 @@ static SEL rlSel;
|
|||
unsigned c = [array count];
|
||||
GS_BEGINIDBUF(objects, c);
|
||||
|
||||
[array getObjects: objects];
|
||||
if ([array isProxy])
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
objects[i] = [array objectAtIndex: i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[array getObjects: objects];
|
||||
}
|
||||
if (shouldCopy == YES)
|
||||
{
|
||||
unsigned i;
|
||||
|
@ -617,7 +645,19 @@ static SEL rlSel;
|
|||
unsigned c = [array count];
|
||||
GS_BEGINIDBUF(objects, c);
|
||||
|
||||
[array getObjects: objects];
|
||||
if ([array isProxy])
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
objects[i] = [array objectAtIndex: i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[array getObjects: objects];
|
||||
}
|
||||
self = [self initWithObjects: objects count: c];
|
||||
GS_ENDIDBUF();
|
||||
return self;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue