1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Refs #28024 -- Optimized GEOSCoordSeq.__getitem__() by avoiding superfluous index and dimension checks.

This commit is contained in:
Sergey Fedoseev 2017-04-05 18:37:04 +05:00 committed by Tim Graham
parent d453dfb1da
commit a296a43309

View File

@ -39,10 +39,8 @@ class GEOSCoordSeq(GEOSBase):
def __getitem__(self, index):
"Return the coordinate sequence value at the given index."
coords = [self.getX(index), self.getY(index)]
if self.dims == 3 and self._z:
coords.append(self.getZ(index))
return tuple(coords)
self._checkindex(index)
return self._point_getter(index)
def __setitem__(self, index, value):
"Set the coordinate sequence value at the given index."