matchit
matchit copied to clipboard
About the CatchAll
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.
This was for /foo/ matching and insert conflict handling, but it can probably be removed with a couple tweaks.
This was changed in #19.