BurntSushi / suffix

Fast suffix arrays for Rust (with Unicode support).
The Unlicense
263 stars 30 forks source link

Fix invariant check in from_parts. #1

Closed danieldk closed 8 years ago

danieldk commented 8 years ago

The suffix array table has the same length as the text in bytes. The invariant check in from_parts, however, checks that the suffix array size is the same as the number of characters. This invariant holds when a string only contains ASCII characters, but it fails otherwise.

Modify the check to use the length of the string in bytes.

BurntSushi commented 8 years ago

Awesome, thank you!