fix(matrix): optimise equals