Skip to content

Commit

Permalink
Merge #520
Browse files Browse the repository at this point in the history
520: `pairs()` is not necessary when iterating over a `Base.Dict` r=DilumAluthge a=DilumAluthge

Addresses #514 (comment)

Co-authored-by: Dilum Aluthge <[email protected]>
  • Loading branch information
bors[bot] and DilumAluthge authored Oct 19, 2023
2 parents d68567d + 079676b commit a4bedb6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/registry_testing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,12 @@ end
# Apply `_spacify_hyphens()` recursively through a dictionary
function _spacify_hyphens(dict::Dict{K, V}) where {K, V}
new_dict = Dict{K, V}()
for (k, v) in pairs(dict)
# Note: `Base.Dict` iterates key-value pairs, so it's sufficient for us to do
# `for (k, v) in dict`. However, there are some other dictionary implementations
# (such as the Dictionaries.jl package) that do not iterate key-value pairs. So,
# if we ever decide to widen the type signature of this method, we'll need to
# change `(k, v) in dict` to `(k, v) in pairs(dict)`.
for (k, v) in dict
new_k = _spacify_hyphens(k)
new_v = _spacify_hyphens(v)
end
Expand Down

0 comments on commit a4bedb6

Please sign in to comment.