matchit icon indicating copy to clipboard operation
matchit copied to clipboard

About the CatchAll

Open kingluo opened this issue 4 years ago • 1 comments

insert a CatchAll node would insert an empty CatchAll node and an actual CatchAll node. Why? For example, for "/foo/*foobar", the final node tree is:

Node {
    priority: 1,
    wild_child: false,
    indices: [
        47,
    ],
    node_type: Root,
    value: None,
    prefix: [
        47,
        102,
        111,
        111,
    ],
    children: [
        Node {
            priority: 1,
            wild_child: true,
            indices: [],
            node_type: CatchAll,
            value: None,
            prefix: [],
            children: [
                Node {
                    priority: 1,
                    wild_child: false,
                    indices: [],
                    node_type: CatchAll,
                    value: Some(
                        UnsafeCell { .. },
                    ),
                    prefix: [
                        47,
                        42,
                        102,
                        111,
                        111,
                        98,
                        97,
                        114,
                    ],
                    children: [],
                },
            ],
        },
    ],
}

If we remove the empty node, the performance is better.

kingluo avatar Oct 31 '21 13:10 kingluo

This was for /foo/ matching and insert conflict handling, but it can probably be removed with a couple tweaks.

ibraheemdev avatar Nov 18 '21 02:11 ibraheemdev

This was changed in #19.

ibraheemdev avatar Sep 01 '22 15:09 ibraheemdev