`rindex` performance improvement