Permalink
Browse files

Simplified GEOSCoordSeq._checkindex().

  • Loading branch information...
1 parent be8d5bd commit 59cad72636dbbff40ea25fc13b39be0a3578f386 @sir-sigurd sir-sigurd committed with timgraham Jul 12, 2017
Showing with 1 addition and 2 deletions.
  1. +1 −2 django/contrib/gis/geos/coordseq.py
@@ -66,8 +66,7 @@ def __setitem__(self, index, value):
# #### 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):

0 comments on commit 59cad72

Please sign in to comment.