Unified · Split
| @@ -712,14 +712,15 @@ let keys_of_string s = · 711 unmodified lines | |||
| 712 | 712 | ||
| 713 | let validatehcs v = | 713 | let validatehcs v = |
| 714 | let l = String.length v in | 714 | let l = String.length v in |
| 715 | if l < 2 then failwith "set is too small, must be greater than one char"; | 715 | if l < 2 |
| 716 | then error "set must contain more than one char, but has %d" l; | ||
| 716 | let module S = Set.Make (struct type t = char let compare = compare end) in | 717 | let module S = Set.Make (struct type t = char let compare = compare end) in |
| 717 | let rec check s i = | 718 | let rec check s i = |
| 718 | if i < l | 719 | if i < l |
| 719 | then | 720 | then |
| 720 | let e = String.get v i in | 721 | let e = String.get v i in |
| 721 | if S.mem e s | 722 | if S.mem e s |
| 722 | then failwith "has duplicates" | 723 | then error "set has duplicates (at least '%c')" e |
| 723 | else check (S.add e s) (i+1) | 724 | else check (S.add e s) (i+1) |
| 724 | in | 725 | in |
| 725 | check (S.singleton (String.get v 0)) 1 | 726 | check (S.singleton (String.get v 0)) 1 |