Kaydet (Commit) a296a433 authored tarafından Sergey Fedoseev's avatar Sergey Fedoseev Kaydeden (comit) Tim Graham

Refs #28024 -- Optimized GEOSCoordSeq.__getitem__() by avoiding superfluous…

Refs #28024 -- Optimized GEOSCoordSeq.__getitem__() by avoiding superfluous index and dimension checks.
üst d453dfb1
...@@ -39,10 +39,8 @@ class GEOSCoordSeq(GEOSBase): ...@@ -39,10 +39,8 @@ class GEOSCoordSeq(GEOSBase):
def __getitem__(self, index): def __getitem__(self, index):
"Return the coordinate sequence value at the given index." "Return the coordinate sequence value at the given index."
coords = [self.getX(index), self.getY(index)] self._checkindex(index)
if self.dims == 3 and self._z: return self._point_getter(index)
coords.append(self.getZ(index))
return tuple(coords)
def __setitem__(self, index, value): def __setitem__(self, index, value):
"Set the coordinate sequence value at the given index." "Set the coordinate sequence value at the given index."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment