@@ -103,18 +103,19 @@ template <typename T> class AbstractList {
103103
104104 /* !
105105 * @brief Get the value at the index.
106- * @note Be safe, that the index exists otherwise the program will crash here!
106+ * @note Be safe, that the index exists otherwise the program will crash
107+ * here!
107108 *
108109 * @param index Index of element to get.
109110 * @return Value.
110111 */
111112 T getValue (int index) {
112- T* ptr = getPointer (index);
113- T val = *ptr;
114- if (!this ->isMutable ()) {
115- free (ptr);
116- }
117- return val;
113+ T * ptr = getPointer (index);
114+ T val = *ptr;
115+ if (!this ->isMutable ()) {
116+ free (ptr);
117+ }
118+ return val;
118119 }
119120
120121 /* !
@@ -157,9 +158,7 @@ template <typename T> class AbstractList {
157158 *
158159 * @param list Other list to copy from.
159160 */
160- void addAll (AbstractList<T> &list) {
161- this ->addAll (this ->getSize (), list);
162- }
161+ void addAll (AbstractList<T> &list) { this ->addAll (this ->getSize (), list); }
163162
164163 /* !
165164 * @brief Add all entries from the given list to this list at the given index.
@@ -171,13 +170,13 @@ template <typename T> class AbstractList {
171170 */
172171 void addAll (int index, AbstractList<T> &list) {
173172 for (int i = 0 ; i < list.getSize (); i++) {
174- T val = list.getValue (i);
175- T *finalValue = (T *)malloc (sizeof (T));
176- memcpy (finalValue, &val, sizeof (T));
177- this ->addAtIndex (index++, *finalValue);
178- if (!this ->isMutable ()) {
179- free (finalValue);
180- }
173+ T val = list.getValue (i);
174+ T *finalValue = (T *)malloc (sizeof (T));
175+ memcpy (finalValue, &val, sizeof (T));
176+ this ->addAtIndex (index++, *finalValue);
177+ if (!this ->isMutable ()) {
178+ free (finalValue);
179+ }
181180 }
182181 }
183182
0 commit comments