From 3f9394fcaba7a32dadc508d7017fe7a72ad048e5 Mon Sep 17 00:00:00 2001 From: TEC Date: Wed, 31 Jul 2024 21:09:11 +0800 Subject: [PATCH] Refactor away the few instances of broadcasting They're harder on the compiler than list comprehensions or mapping. --- src/internals.jl | 2 +- src/unix.jl | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/internals.jl b/src/internals.jl index a538876..5faca9c 100644 --- a/src/internals.jl +++ b/src/internals.jl @@ -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 diff --git a/src/unix.jl b/src/unix.jl index 2a6f80f..a023f5e 100644 --- a/src/unix.jl +++ b/src/unix.jl @@ -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