aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-06-29 10:23:29 -0700
committerChris Robinson <[email protected]>2019-06-29 10:23:29 -0700
commit12911cc533a94c6aa99c0db57394b75d3fcb3f67 (patch)
tree5b9b95c26d0cb00d2048725ddd88a893001db567
parent3ede66ae4580913b2dcec44de4481a4e50574bf4 (diff)
Use a range-for loop to concatenate available backends
-rw-r--r--Alc/alc.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 834419c3..23cc4826 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -943,16 +943,21 @@ static void alc_initconfig(void)
else ERR("Failed to open log file '%s'\n", str);
}
- TRACE("Initializing library v%s-%s %s\n", ALSOFT_VERSION,
- ALSOFT_GIT_COMMIT_HASH, ALSOFT_GIT_BRANCH);
+ TRACE("Initializing library v%s-%s %s\n", ALSOFT_VERSION, ALSOFT_GIT_COMMIT_HASH,
+ ALSOFT_GIT_BRANCH);
{
std::string names;
- if(std::begin(BackendList) != BackendListEnd)
- names += BackendList[0].name;
- for(auto backend = std::begin(BackendList)+1;backend != BackendListEnd;++backend)
+ if(std::begin(BackendList) == BackendListEnd)
+ names += "(none)";
+ else
{
- names += ", ";
- names += backend->name;
+ const al::span<const BackendInfo> infos{std::begin(BackendList), BackendListEnd};
+ names += infos[0].name;
+ for(const auto &backend : infos.subspan(1))
+ {
+ names += ", ";
+ names += backend.name;
+ }
}
TRACE("Supported backends: %s\n", names.c_str());
}