From 998c1f0eebf560fc14b46105e8fb46722b555a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=2E=20Garc=C3=ADa?= <70865364+ws-garcia@users.noreply.github.com> Date: Tue, 7 Feb 2023 23:16:29 -0400 Subject: [PATCH] Bug fixed: undesired behavior of the `Copy` method of CSVArrayList when the given end index exceeded the current amount of data in the instance. --- src/CSVArrayList.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CSVArrayList.cls b/src/CSVArrayList.cls index 04fcc33..01b8a86 100644 --- a/src/CSVArrayList.cls +++ b/src/CSVArrayList.cls @@ -978,7 +978,7 @@ 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 @@ -986,7 +986,7 @@ Attribute Copy.VB_Description = "Returns a copy of the current instance." 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