summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-07-12 22:09:00 +0500
committerTim Graham <timograham@gmail.com>2017-07-13 12:46:59 -0400
commit59cad72636dbbff40ea25fc13b39be0a3578f386 (patch)
treeeea9160fb8e03de1032f6f29bdbaced46e81eece
parentbe8d5bd7031468e64264e333a42833cb0e0d0fe8 (diff)
Simplified GEOSCoordSeq._checkindex().
-rw-r--r--django/contrib/gis/geos/coordseq.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/django/contrib/gis/geos/coordseq.py b/django/contrib/gis/geos/coordseq.py
index 28f69221db..6ea0fe9be3 100644
--- a/django/contrib/gis/geos/coordseq.py
+++ b/django/contrib/gis/geos/coordseq.py
@@ -66,8 +66,7 @@ class GEOSCoordSeq(GEOSBase):
# #### Internal Routines ####
def _checkindex(self, index):
"Check the given index."
- sz = self.size
- if (sz < 1) or (index < 0) or (index >= sz):
+ if not (0 <= index < self.size):
raise IndexError('invalid GEOS Geometry index: %s' % index)
def _checkdim(self, dim):