This commit is contained in:
2025-02-28 14:24:22 +03:30
parent a266ed533b
commit c3bc38befb
7 changed files with 2138 additions and 97 deletions
+85
View File
@@ -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;
}
//