simplify earcut, make it much faster