cc: Use parameter expansion instead of basename (#24509)
While debugging #24508, I noticed that we call `basename` in `cc`. The same can be achieved by using Bash's parameter expansion, saving one external process per call. Parameter expansion cannot replace basename for directories in some cases, but is guaranteed to work for executables.
This commit is contained in:
2
lib/spack/env/cc
vendored
2
lib/spack/env/cc
vendored
@@ -128,7 +128,7 @@ fi
|
||||
# ld link
|
||||
# ccld compile & link
|
||||
|
||||
command=$(basename "$0")
|
||||
command="${0##*/}"
|
||||
comp="CC"
|
||||
case "$command" in
|
||||
cpp)
|
||||
|
Reference in New Issue
Block a user