Currently, regexp-opt does not attempt optimisation with KEEP-ORDER set if the input list contains a proper prefix of another element, like ("ab" "abcd") on the grounds that the optimised string would be "ab\\(?:cd\\)?" which would not preserve the match order. However, this also prevents ("abcd" "ab") from being optimised, even though doing so would be harmless. The attached patch strengthens the check, allowing more inputs to be optimised.