There's already a cursorEqual() function for this.