src/siri/db/points.c
/*
 * Add a point to points. (points are sorted by timestamp so the new point
 * will be inserted at the correct position.
 *
 * Warning:
 *      this functions assumes points to be large enough to hold the new
 *      point and is therefore not safe.
 */
Add a point to points. (points are sorted by timestamp so the new point
will be inserted at the correct position.

this functions assumes points to be large enough to hold the new
point and is therefore not safe.
Add a point to points . ( points are sorted by timestamp so the new point will be inserted at the correct position . this functions assumes points to be large enough to hold the new point and is therefore not safe .
void siridb_points_add_point(
        siridb_points_t *__restrict points,
        uint64_t * ts,
        qp_via_t * val)
{
    size_t i;
    siridb_point_t * point;
    for (   i = points->len;
            i-- > 0 && (points->data + i)->ts > *ts;
            *(points->data + i + 1) = *(points->data + i));
    points->len++;
    point = points->data + i + 1;
    point->ts = *ts;
    point->val = *val;
}
void siridb_points_add_point ( siridb_points_t * __restrict points , uint64_t * ts , qp_via_t * val ) { size_t i ; siridb_point_t * point ; for ( i = points -> len ; i -- > 0 && ( points -> data + i ) -> ts > * ts ; * ( points -> data + i + 1 ) = * ( points -> data + i ) ) ; points -> len ++ ; point = points -> data + i + 1 ; point -> ts = * ts ; point -> val = * val ; }
Add a point to points.
Add a point to points .