improve KeyImpl.equal