From 626ab29fc71194240364f7f1a45f75b0c79af469 Mon Sep 17 00:00:00 2001 From: Speiger Date: Sun, 27 Jun 2021 17:23:34 +0200 Subject: [PATCH] Lists.addElements(T...elements) was adding elements at the beginning of a list instead of the end. --- Changelog.md | 1 + .../speiger/assets/collections/templates/lists/List.template | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 1466b3b0..c213b63d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,7 @@ - Added: CustomOpenHashSets now implement foreach and have less overhead. - Added: ImmutableOpenHashMap that is not editable (is linked by default for fast iteration) - Added: Maps can now be created through the interface. +- Fixed: Lists.addElements(T...elements) was adding elements at the beginning of a list instead of the end. ### Version 0.3.1 - Fixed: containsKey & containsValue in HashMaps were deprecated for Object Variants. diff --git a/src/builder/resources/speiger/assets/collections/templates/lists/List.template b/src/builder/resources/speiger/assets/collections/templates/lists/List.template index 7c2a44f9..7e68dd2c 100644 --- a/src/builder/resources/speiger/assets/collections/templates/lists/List.template +++ b/src/builder/resources/speiger/assets/collections/templates/lists/List.template @@ -152,7 +152,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List * @param a the elements that should be added * @throws IndexOutOfBoundsException if from is outside of the lists range */ - public default void addElements(KEY_TYPE... a) { addElements(0, a, 0, a.length); } + public default void addElements(KEY_TYPE... a) { addElements(size(), a, 0, a.length); } /** * A function to fast add elements to the list