avoid unnecessary strlen (#3058)

2 files changed