Skip to content

Commit

Permalink
Merge pull request #38 from kudlatyamroth/bugfix/on-merge-all-of-omit…
Browse files Browse the repository at this point in the history
…-duplicates

fix: omit duplicates in array when merging
  • Loading branch information
kstasik authored Aug 9, 2021
2 parents 932baa1 + 6607e99 commit bcb2c5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/process/merge_allof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ fn merge_values(a: &mut Value, b: Value, options: &MergerOptions) {
(a @ &mut Value::Array(_), Value::Array(b)) => {
let a = a.as_array_mut().unwrap();
for v in b {
a.push(v);
if !a.contains(&v) {
a.push(v);
}
}
}
(a, b) => *a = b,
Expand Down

0 comments on commit bcb2c5d

Please sign in to comment.