PoeMac/C workers/percentile.c
static void cm_add_to_buffer(cm_quantile *cm, double value) {
    // Allocate a new sample
    cm_sample *s = calloc(1, sizeof(cm_sample));
    s->value = value;

    /*
     * Check the cursor value.
     * Only use bufLess if we have at least a single value.
     */
    if (cm->num_values && value < cm_insert_point_value(cm)) {
        heap_insert(cm->bufLess, &s->value, s);
    } else {
        heap_insert(cm->bufMore, &s->value, s);
    }
}
/**
 * Adds a new sample to the buffer
 */
Adds a new sample to the buffer
Adds a new sample to the buffer
static void cm_add_to_buffer(cm_quantile *cm, double value) {
    cm_sample *s = calloc(1, sizeof(cm_sample));
    s->value = value;
    if (cm->num_values && value < cm_insert_point_value(cm)) {
        heap_insert(cm->bufLess, &s->value, s);
    } else {
        heap_insert(cm->bufMore, &s->value, s);
    }
}
static void cm_add_to_buffer ( cm_quantile * cm , double value ) { cm_sample * s = calloc ( 1 , sizeof ( cm_sample ) ) ; s -> value = value ; if ( cm -> num_values && value < cm_insert_point_value ( cm ) ) { heap_insert ( cm -> bufLess , & s -> value , s ) ; } else { heap_insert ( cm -> bufMore , & s -> value , s ) ; } }
Adds a new sample to the buffer
Adds a new sample to the buffer
// Allocate a new sample /*
     * Check the cursor value.
     * Only use bufLess if we have at least a single value.
     */