Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbc6cea

Browse files
committed
Optimize convert_polygon_vector a bit
1 parent beb989e commit dbc6cea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_path_wrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ convert_polygon_vector(std::vector<Polygon> &polygons)
2525
auto result = py::list(polygons.size());
2626

2727
for (size_t i = 0; i < polygons.size(); ++i) {
28-
Polygon poly = polygons[i];
28+
const auto& poly = polygons[i];
2929
py::ssize_t dims[] = { static_cast<py::ssize_t>(poly.size()), 2 };
30-
result[i] = py::array(dims, reinterpret_cast<double *>(poly.data()));
30+
result[i] = py::array(dims, reinterpret_cast<const double *>(poly.data()));
3131
}
3232

3333
return result;

0 commit comments

Comments
 (0)