Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and symmetrize "less than" and "prefix"
We had a definition of (code unit) "prefix" for strings, but "starts with" for byte sequences, which led to usage errors within the corresponding "less than" algorithms. This makes "prefix" the primary operation for both strings and byte sequences, with dedicated <dfn>s for "starts with" for both. Then, it fixes "less than" for byte sequences to use "prefix" instead of "starts with", which makes the algorithm correct and closes #309. Additionally, this fixes the code unit prefix algorithm to be correct instead of backward, and updates the variable names from "a" and "b" to "potentialPrefix" and "input" for clarity.
- Loading branch information
Showing
1 changed file
with
31 additions
and
23 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