Skip to content

Commit

Permalink
Bug fixed: undesired behavior of the Copy method of CSVArrayList wh…
Browse files Browse the repository at this point in the history
…en the given end index exceeded the current amount of data in the instance.
  • Loading branch information
ws-garcia committed Feb 8, 2023
1 parent 186b020 commit 998c1f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CSVArrayList.cls
Original file line number Diff line number Diff line change
Expand Up @@ -978,15 +978,15 @@ Attribute Copy.VB_Description = "Returns a copy of the current instance."

Set Copy = New CSVArrayList
If Not P_INDEXING Then
If endIndex = -1 Then
If endIndex = -1 Or endIndex > CurrentIndex Then
endIndex = CurrentIndex
End If
Copy.Reinitialize endIndex - startIndex + 1
For c = startIndex To endIndex
Copy.Add Buffer(c)
Next c
Else
If endIndex = -1 Then
If endIndex = -1 Or endIndex > IndexedCurrentIndex Then
endIndex = IndexedCurrentIndex
End If
Copy.Reinitialize endIndex - startIndex + 1
Expand Down

0 comments on commit 998c1f0

Please sign in to comment.