1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibRegex: Avoid excessive Vector copy when compiling regexps

Previously we would've copied the bytecode instead of moving the chunks
around, use the fancy new DisjointChunks<T> abstraction to make that
happen automagically.
This decreases vector copies and uses of memmove() by nearly 10x :^)
This commit is contained in:
Ali Mohammad Pur 2021-09-13 23:45:22 +04:30 committed by Ali Mohammad Pur
parent 7e75a16e6f
commit bf0315ff8f
3 changed files with 53 additions and 23 deletions

View file

@ -12,7 +12,7 @@ namespace regex {
class Optimizer {
public:
static void append_alternation(ByteCode& target, ByteCode& left, ByteCode& right);
static void append_alternation(ByteCode& target, ByteCode&& left, ByteCode&& right);
};
}