Skip to content

Commit

Permalink
Tweak some nfdb functions
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Oct 12, 2023
1 parent 8f64388 commit 9dc7c57
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions examples/NFDB.jl
Original file line number Diff line number Diff line change
Expand Up @@ -994,10 +994,12 @@ end
#
################################################################################

function Base.merge!(R::NFDB{1}, D1::NFDB{1})
function Base.merge!(R::NFDB{1}, D1::NFDB{1}; skip_update = false)
sizehint!(R.fields, length(R) + length(D1))
append!(R.fields, D1.fields)
update_properties!(R)
if !skip_update
update_properties!(R)
end
return R
end

Expand All @@ -1014,10 +1016,13 @@ function Base.merge(D::Vector{NFDB{1}})
end

R = NFDB{1}()
sizehint!(R.fields, sum(length(d) for d in D))
for i in 1:length(D)
merge!(R, D[i])
merge!(R, D[i], skip_update = true)
end

update_properties!(R)

return R
end

Expand Down

0 comments on commit 9dc7c57

Please sign in to comment.