[minor] Use ~ operator to check for -1

This is mainly a style change as other expressjs modules use this.
Performance is mostly indifferent.
However, this tests specifically for -1.
[benchmarks] Updated for 26cd6df.