Skip to content

Commit

Permalink
Aktualisieren von aa.d
Browse files Browse the repository at this point in the history
  • Loading branch information
UIMSolutions authored Jan 3, 2024
1 parent 6488d4e commit d6c0792
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/uim/core/containers/aa.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ unittest {

/// get values of an associative array - currently not working für objects
V[] getValues(K, V)(V[K] aa, bool sorted = NOTSORTED) {
V[] results;
foreach(k, v; aa) results ~= v;
V[] results = aa.values.map!(v => v).array;
if (sorted) return results.sort.array;
return results;
}
Expand All @@ -51,9 +50,10 @@ version(test_uim_core) { unittest {
}}

// Add Items from array
T[S] add(T, S)(T[S] baseItems, T[S] addItems) {
T[S] results = baseItems.dup;
foreach(k, v; addItems) results[k] = v;
T[S] add(T, S)(T[S] targetItems, T[S] addItems) {
T[S] results = targetItems;
addItems.byKeyValue
.each!(kv => results[kv.key] = kv.value);
return results;
}
version(test_uim_core) { unittest {
Expand Down

0 comments on commit d6c0792

Please sign in to comment.