Fix issue 15, extract code into is_row_equal