Simplify implementation of pic_equal_p