ts_lib: strrev check then swap