-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
regcomp.c: Add shortcuts to some inversion list ops
When taking the union or intersection of two inversion lists, not infrequently the result is the same as one of the inputs. An example is the union of a set that contains all code points with any other set. The result is the set that contains all code points. Also, not infrequently, the result is to overwrite one of the inputs. If the other input contributed nothing to the result, the whole operation is effectively a no-op, as the result has the same contents as the input it overwrites. It turns out that it is cheap to keep track of if just one input contributes to the result. This commit does that, and short-circuits the rest of the code if it is going to turn out to be a no-op.
- Loading branch information
1 parent
e67bc19
commit c29dfc6
Showing
1 changed file
with
106 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters