Мы используем куки, чтобы пользоваться сайтом было удобно.
Хорошо
to the top

Вебинар: Стратегия без иллюзий: как превращать цели в результаты - 19.08

>
>
>
Примеры ошибок, обнаруженных с...

Примеры ошибок, обнаруженных с помощью диагностики V714

V714. Variable is not passed into foreach loop by reference, but its value is changed inside of the loop.


OrcaSlicer

V714 Variable 'face' is not passed into foreach loop by a reference, but its value is changed inside of the loop. MeshBoolean.cpp 153


template<class _Mesh>
  void triangle_mesh_to_cgal(const TriangleMesh& M, _Mesh& out)
{
  // ....
  // Number the faces because 'orient_to_bound_a_volume'
  // needs a face <--> index map
  unsigned index = 0;
  for (auto face : out.faces())          // <=
    face = CGAL::SM_Face_index(index++);
  // ....
}

Krita

V714 Variable row is not passed into for each loop by a reference, but its value is changed inside of the loop. kis_algebra_2d.cpp 532


DecomposedMatix::DecomposedMatix(const QTransform &t0)
{
    ....
    if (!qFuzzyCompare(t.m33(), 1.0)) {
        const qreal invM33 = 1.0 / t.m33();

        for (auto row : rows) { // <=
            row *= invM33;
        }
    }
    ....
}

Ты поймал бага за сек!
А мы в коде ловим их за доли секунды. Хочешь проверить?

Попробовать бесплатно