Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
Co-Authored-By: Jameson Nash <[email protected]>
  • Loading branch information
IanButterworth and vtjnash committed Sep 4, 2024
1 parent 91b546e commit efe62b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions stdlib/Profile/src/Profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -504,20 +504,20 @@ function flatten(data::Vector, lidict::LineInfoDict)
end

const SRC_DIR = normpath(joinpath(Sys.BUILD_ROOT_PATH, "src"))
const LIB_DIR = normpath(joinpath(Sys.BUILD_ROOT_PATH, "usr", "lib"))

# Take a file-system path and try to form a concise representation of it
# based on the package ecosystem
function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,String,String}})
return get!(filenamecache, spath) do
path = Base.fixup_stdlib_path(string(spath))
possible_base_path = normpath(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "base", path))
lib_dir = abspath(Sys.BINDIR, Base.LIBDIR)
if startswith(path, SRC_DIR)
remainder = only(split(path, SRC_DIR, keepempty=false))
return (isfile(path) ? path : ""), "@src", remainder
elseif startswith(path, LIB_DIR)
remainder = only(split(path, LIB_DIR, keepempty=false))
return (isfile(path) ? path : ""), "@lib", remainder
return (isfile(path) ? path : ""), "@juliasrc", remainder
elseif startswith(path, lib_dir)
remainder = only(split(path, lib_dir, keepempty=false))
return (isfile(path) ? path : ""), "@julialib", remainder
elseif isabspath(path)
if ispath(path)
# try to replace the file-system prefix with a short "@Module" one,
Expand Down

0 comments on commit efe62b3

Please sign in to comment.