last ...
This commit is contained in:
@@ -4221,4 +4221,89 @@ int GetLowest(
|
||||
return result;
|
||||
}
|
||||
|
||||
bool AddIfNotExists(
|
||||
XOBFVG &item,
|
||||
XOBFVG &items[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = item.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int before = ArraySize(items);
|
||||
|
||||
//
|
||||
int idx = FindIndex(
|
||||
item,
|
||||
items //
|
||||
);
|
||||
bool has = IsValidIndex(idx);
|
||||
result = !has;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
AddRef(
|
||||
item,
|
||||
items //
|
||||
);
|
||||
|
||||
//
|
||||
int after = ArraySize(items);
|
||||
|
||||
//
|
||||
result = after > before;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
int AddIfNotExists(
|
||||
XOBFVG &items[],
|
||||
XOBFVG &sources[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
bool has = HasChild(items);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int before = ArraySize(sources);
|
||||
|
||||
//
|
||||
int count = ArraySize(items);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
has = AddIfNotExists(
|
||||
items[i],
|
||||
sources //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
int after = ArraySize(sources);
|
||||
|
||||
//
|
||||
result = after > before;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user