Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2026-06-19 0cfc87bd32822e5ba22d8c2b1a26fa60f63ad7fa
contrib/postgis/liblwgeom/ptarray.c
@@ -768,12 +768,6 @@
      seg2 = getPoint2d_cp(pa, i);
      /* This is required for robustness, see #6023 */
      if (p2d_same(seg1, pt))
      {
         return LW_BOUNDARY;
      }
      /* Zero length segments are ignored. */
      if (p2d_same(seg1, seg2))
      {
@@ -1840,9 +1834,11 @@
   /* Append last point */
   kept_it++;
   if (kept_it != last_it)
/*#<<<DIA_SVACE_CRITICAL*/
      memmove(pa->serialized_pointlist + pt_size * kept_it,
            pa->serialized_pointlist + pt_size * last_it,
            pt_size);
/*#DIA_SVACE_CRITICAL>>>*/
   pa->npoints = kept_it + 1;
}
@@ -1908,9 +1904,11 @@
   {
      /* If there are 2 points remaining, it has to be first and last as
       * we added those at the start */
/*#<<<DIA_SVACE_CRITICAL*/
      memmove(pa->serialized_pointlist + pt_size * kept_it,
             pa->serialized_pointlist + pt_size * (pa->npoints - 1),
             pt_size);
/*#DIA_SVACE_CRITICAL>>>*/
   }
   else if (pa->npoints != keptn) /* We don't need to move any points if we are keeping them all */
   {