go-ipfs-config: profile: fix test profile tests
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
Łukasz Magiera committed
Mar 30, 2018 at 20:38 UTC
a55c0fb51d842c9f52c52c16d8450bb32319d779
1 file changed
+11
-4
config/profile.go
+11
-4
@@ -162,14 +162,21 @@ fetching may be degraded.
162
}
163
164
func appendSingle(a []string, b []string) []string {
165
- m := map[string]struct{}{}
165
+ out := make([]string, 0, len(a)+len(b))
166
+ m := map[string]bool{}
167
for _, f := range a {
167
- m[f] = struct{}{}
168
+ if !m[f] {
169
+ out = append(out, f)
170
+ }
171
+ m[f] = true
172
}
173
for _, f := range b {
170
- m[f] = struct{}{}
174
+ if !m[f] {
175
+ out = append(out, f)
176
+ }
177
+ m[f] = true
178
}
172
- return mapKeys(m)
179
+ return out
180
}
181
182
func deleteEntries(arr []string, del []string) []string {