server/modules/selva/module/subscriptions.c
static void field_change_precheck(
        RedisModuleCtx *ctx,
        const struct SelvaModify_HierarchyNode *node,
        const struct Selva_SubscriptionMarkers *sub_markers) {
    const unsigned short flags = SELVA_SUBSCRIPTION_FLAG_CH_FIELD;

    if ((sub_markers->flags_filter & flags) == flags) {
        struct SVectorIterator it;
        struct Selva_SubscriptionMarker *marker;

        SVector_ForeachBegin(&it, &sub_markers->vec);
        while ((marker = SVector_Foreach(&it))) {
            if ((marker->marker_flags & flags) == flags) {
                /*
                 * Store the filter result before any changes to the node.
                 * We assume that SelvaSubscriptions_DeferFieldChangeEvents()
                 * is called before this function is called for another node.
                 */
                SelvaHierarchy_GetNodeId(marker->filter_history.node_id, node);
                marker->filter_history.res = Selva_SubscriptionFilterMatch(ctx, node, marker);
            }
        }
    }
}
/**
 * Check whether the filter matches before changing the value of a node field.
 */
Check whether the filter matches before changing the value of a node field.
Check whether the filter matches before changing the value of a node field .
static void field_change_precheck(
        RedisModuleCtx *ctx,
        const struct SelvaModify_HierarchyNode *node,
        const struct Selva_SubscriptionMarkers *sub_markers) {
    const unsigned short flags = SELVA_SUBSCRIPTION_FLAG_CH_FIELD;
    if ((sub_markers->flags_filter & flags) == flags) {
        struct SVectorIterator it;
        struct Selva_SubscriptionMarker *marker;
        SVector_ForeachBegin(&it, &sub_markers->vec);
        while ((marker = SVector_Foreach(&it))) {
            if ((marker->marker_flags & flags) == flags) {
                SelvaHierarchy_GetNodeId(marker->filter_history.node_id, node);
                marker->filter_history.res = Selva_SubscriptionFilterMatch(ctx, node, marker);
            }
        }
    }
}
static void field_change_precheck ( RedisModuleCtx * ctx , const struct SelvaModify_HierarchyNode * node , const struct Selva_SubscriptionMarkers * sub_markers ) { const unsigned short flags = SELVA_SUBSCRIPTION_FLAG_CH_FIELD ; if ( ( sub_markers -> flags_filter & flags ) == flags ) { struct SVectorIterator it ; struct Selva_SubscriptionMarker * marker ; SVector_ForeachBegin ( & it , & sub_markers -> vec ) ; while ( ( marker = SVector_Foreach ( & it ) ) ) { if ( ( marker -> marker_flags & flags ) == flags ) { SelvaHierarchy_GetNodeId ( marker -> filter_history . node_id , node ) ; marker -> filter_history . res = Selva_SubscriptionFilterMatch ( ctx , node , marker ) ; } } } }
Check whether the filter matches before changing the value of a node field.
Check whether the filter matches before changing the value of a node field .
/*
                 * Store the filter result before any changes to the node.
                 * We assume that SelvaSubscriptions_DeferFieldChangeEvents()
                 * is called before this function is called for another node.
                 */