forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base: add CompareSuffixes to Comparer
We currently use `Compare` to compare both keys and bare suffixes. This makes the implementation more complicated as it has to handle both cases. It also prevents adding many useful assertions - for example, we can't verify that `Compare` does byte-wise comparison of prefixes because we can't unconditionally call `Split`. We add a mandatory `CompareSuffixes` method that is used when comparing bare suffixes. The result of `Compare` can be defined completely in terms of `Split` and `CompareSuffixes`; `Compare` now has a default implementation. We also add a `CheckComparer` testing facility that can be used to verify `Split` and `Compare` on combinations of prefixes and suffixes. We use it to add a test to all `Comparer`s and it will be used from CRDB code as well. Informs cockroachdb/cockroach#127914
- Loading branch information
1 parent
4cc91d2
commit 45e35f8
Showing
33 changed files
with
390 additions
and
209 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
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
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
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
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
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
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
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
Oops, something went wrong.