Format all C++ and Java code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 14:32:37 +07:00
parent 9f0290c0ec
commit bfffa1fff4
2169 changed files with 56441 additions and 64188 deletions

View File

@@ -2,30 +2,28 @@
// Similar to set_difference(), but if element is present n times in the first sequence and once in
// the second sequence, all n copies are filtered, insted of one.
template<typename Iter1T, typename Iter2T, typename OutIterT, typename LessT>
OutIterT SetDifferenceUnlimited(Iter1T beg1, Iter1T end1,
Iter2T beg2, Iter2T end2,
OutIterT out, LessT lessCompare)
template <typename Iter1T, typename Iter2T, typename OutIterT, typename LessT>
OutIterT SetDifferenceUnlimited(Iter1T beg1, Iter1T end1, Iter2T beg2, Iter2T end2, OutIterT out, LessT lessCompare)
{
while (beg1 != end1 && beg2 != end2)
{
while (beg1 != end1 && beg2 != end2)
if (lessCompare(*beg1, *beg2))
{
if (lessCompare(*beg1, *beg2))
{
*out = *beg1;
++beg1;
++out;
}
else if (lessCompare(*beg2, *beg1))
{
++beg2;
}
else
{
++beg1;
// This is the difference between set_difference and this function:
// In set_difference the commented line should be present.
// ++beg2;
}
*out = *beg1;
++beg1;
++out;
}
else if (lessCompare(*beg2, *beg1))
{
++beg2;
}
else
{
++beg1;
// This is the difference between set_difference and this function:
// In set_difference the commented line should be present.
// ++beg2;
}
return std::copy(beg1, end1, out);
}
return std::copy(beg1, end1, out);
}