Shouldn't this be `to` instead of `from+1` since we've already established that they're the same thing?  Or, alternatively, to make this less fragile to bad input (e.g. `to` less than `from`), test `to <= from+1` (but then I don't know whether `to` or `from+1` is more expected--maybe just throw an exception instead)?