Yeah, but not `startOffset == end`, should be `pos == end`. I make a mistake here.

`if (pos == end) return 1.0f;` is OK.