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

@@ -52,8 +52,7 @@ void SimplifyDP(Iter first, Iter last, double epsilon, DistanceFn & distFn, Out
struct SimplifyOptimalRes
{
SimplifyOptimalRes() = default;
SimplifyOptimalRes(int32_t nextPoint, uint32_t pointCount)
: m_NextPoint(nextPoint), m_PointCount(pointCount) {}
SimplifyOptimalRes(int32_t nextPoint, uint32_t pointCount) : m_NextPoint(nextPoint), m_PointCount(pointCount) {}
int32_t m_NextPoint = -1;
uint32_t m_PointCount = -1U;
@@ -80,8 +79,7 @@ void SimplifyDP(Iter beg, Iter end, double epsilon, DistanceFn distFn, Out out)
// Essentially, it's a trade-off between optimality and performance.
// Values around 20 - 200 are reasonable.
template <typename DistanceFn, typename Iter, typename Out>
void SimplifyNearOptimal(int maxFalseLookAhead, Iter beg, Iter end, double epsilon,
DistanceFn distFn, Out out)
void SimplifyNearOptimal(int maxFalseLookAhead, Iter beg, Iter end, double epsilon, DistanceFn distFn, Out out)
{
int32_t const n = static_cast<int32_t>(end - beg);
if (n <= 2)
@@ -124,21 +122,20 @@ class AccumulateSkipSmallTrg
{
public:
AccumulateSkipSmallTrg(DistanceFn & distFn, std::vector<Point> & vec, double eps)
: m_distFn(distFn), m_vec(vec), m_eps(eps)
{
}
: m_distFn(distFn)
, m_vec(vec)
, m_eps(eps)
{}
void operator()(Point const & p) const
{
// remove points while they make linear triangle with p
size_t count;
while ((count = m_vec.size()) >= 2)
{
if (m_distFn(m_vec[count - 2], p, m_vec[count - 1]) < m_eps)
m_vec.pop_back();
else
break;
}
m_vec.push_back(p);
}