Skip to content

Commit

Permalink
Refactor away the few instances of broadcasting
Browse files Browse the repository at this point in the history
They're harder on the compiler than list comprehensions or mapping.
  • Loading branch information
tecosaur committed Jul 31, 2024
1 parent 7dcc50f commit 9ef9746
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/internals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function resolvedirpath(basedir::String, pathcomponents::Union{Tuple, AbstractVe
end

function resolvedirpaths(basedirs::Vector{String}, pathcomponents::Union{Tuple, AbstractVector}; create::Bool=false, existent::Bool=false)
allpaths = resolvedirpath.(basedirs, Ref(pathcomponents); create)
allpaths = [resolvedirpath(bdir, pathcomponents; create) for bdir in basedirs]
if existent
filter(ispath, allpaths)
else
Expand Down
7 changes: 3 additions & 4 deletions src/unix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ function reload()
@setxdg PUBLICSHARE_DIR get(userdirs, :XDG_PUBLICSHARE_DIR, "~/Public")
# Other directories
FONTS_DIRS[] =
append!([joinpath(DATA_HOME[], "fonts"),
expanduser("~/.fonts")],
joinpath.(DATA_DIRS[], "fonts")) |> unique!
append!([joinpath(DATA_HOME[], "fonts"), expanduser("~/.fonts")],
[joinpath(d, "fonts") for d in DATA_DIRS[]]) |> unique!
APPLICATIONS_DIRS[] =
append!([joinpath(DATA_HOME[], "applications")],
joinpath.(DATA_DIRS[], "applications")) |> unique!
[joinpath(d, "applications") for d in DATA_DIRS[]]) |> unique!
nothing
end

Expand Down

0 comments on commit 9ef9746

Please sign in to comment.