Skip to content

Commit

Permalink
don't know why i thought python arrays start at 1...
Browse files Browse the repository at this point in the history
  • Loading branch information
tjrocha committed Jan 29, 2019
1 parent 7f5f04b commit cc6bead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def appendDatasetDictionaryItem(self, dataID, stationType, stationNumber, statio
duplicateDataset = False
#Add validation code to see if dataset already exists in datasetDirectory

for dCounter in range(1, len(self.datasetDirectory['datasets'])):
for dCounter in range(0, len(self.datasetDirectory['datasets'])):
if self.datasetDirectory['datasets'][dCounter]["TYPE"] == stationType and self.datasetDirectory['datasets'][dCounter]["ID"] == stationNumber and self.datasetDirectory['datasets'][dCounter]["Name"] == stationName and self.datasetDirectory['datasets'][dCounter]["Parameter"] == stationParam and self.datasetDirectory['datasets'][dCounter]["Units"] == stationUnits:
duplicateDataset = True
break
Expand Down

1 comment on commit cc6bead

@blounsbury-usbr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already a Python guru I see. Note also since you are starting at the default 0, then range(len()) is equivalent with less typing.

Please sign in to comment.