Optimization to Polygon.contains().