Improve performance of q-constraint triplet search in spglib