Browse Source

Fix issues with ArrayList conversion

We are just copying `DynamicArray` into `ArrayList` with slightly
different behavior. There are still no tests and some small errors pop
up due to changes being made. This patch fixes them.
pull/8/head
Anton Tarasenko 2 years ago
parent
commit
9c4966e93a
  1. 3
      sources/Data/Collections/ArrayList.uc
  2. 5
      sources/Data/Collections/ArrayListIterator.uc

3
sources/Data/Collections/ArrayList.uc

@ -164,8 +164,7 @@ public final function ArrayList Insert(int index, int count)
*/ */
protected final function Swap(int index1, int index2) protected final function Swap(int index1, int index2)
{ {
local AcediaObject temporaryItem; local AcediaObject temporaryItem;
local int temporaryNumber;
// Swap object // Swap object
temporaryItem = storedObjects[index1]; temporaryItem = storedObjects[index1];

5
sources/Data/Collections/ArrayListIterator.uc

@ -17,7 +17,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. * along with Acedia. If not, see <https://www.gnu.org/licenses/>.
*/ */
class ArrayListIterator extends Iter; class ArrayListIterator extends Iter
dependson(ArrayList);
var private ArrayList relevantCollection; var private ArrayList relevantCollection;
var private int currentIndex; var private int currentIndex;
@ -45,7 +46,7 @@ public function LeaveOnlyNotNone()
skipNoneReferences = true; skipNoneReferences = true;
} }
public function Iter Next() public function Iter Next(optional bool deprecated)
{ {
local int collectionLength; local int collectionLength;
if (!skipNoneReferences) if (!skipNoneReferences)

Loading…
Cancel
Save