Skip to content

Commit

Permalink
add a merge method for Pairs of NamedTuple to speed up keyword …
Browse files Browse the repository at this point in the history
…splatting (#25936)

fixes #9551
  • Loading branch information
JeffBezanson committed Feb 8, 2018
1 parent 2017524 commit b85d5a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions base/namedtuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ end

merge(a::NamedTuple{()}, b::NamedTuple) = b

merge(a::NamedTuple, b::Iterators.Pairs{<:Any,<:Any,<:Any,<:NamedTuple}) = merge(a, b.data)

"""
merge(a::NamedTuple, iterable)
Expand Down
7 changes: 4 additions & 3 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ Array{T}(::Missing, d...) where {T} = fill!(Array{T}(uninitialized, d...), missi

include("abstractdict.jl")

include("iterators.jl")
using .Iterators: zip, enumerate
using .Iterators: Flatten, product # for generators

include("namedtuple.jl")

# numeric operations
Expand Down Expand Up @@ -207,9 +211,6 @@ include("some.jl")

include("dict.jl")
include("set.jl")
include("iterators.jl")
using .Iterators: zip, enumerate
using .Iterators: Flatten, product # for generators

include("char.jl")
include("strings/basic.jl")
Expand Down

0 comments on commit b85d5a1

Please sign in to comment.