Fix .equals() calls to empty string

It is normally more performant to test a String for emptiness by
comparing its .length() to zero instead.