aboutsummaryrefslogtreecommitdiffstats
path: root/al/extension.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-05-08 14:47:19 -0700
committerChris Robinson <[email protected]>2023-05-08 14:47:19 -0700
commite42681c4472b8a149a8f1e68614e4f5ee5d04fb0 (patch)
treecc01c5aeddf58f56d0a82f065ff9265fa7dd5661 /al/extension.cpp
parent755a6e15b5665914a6d67157abc1060746e658b0 (diff)
Store extension strings individually
And dynamically build the full AL_EXTENSIONS string
Diffstat (limited to 'al/extension.cpp')
-rw-r--r--al/extension.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/al/extension.cpp b/al/extension.cpp
index 3ead0af8..dbaf4d5f 100644
--- a/al/extension.cpp
+++ b/al/extension.cpp
@@ -46,18 +46,10 @@ START_API_FUNC
}
size_t len{strlen(extName)};
- const char *ptr{context->mExtensionList};
- while(ptr && *ptr)
+ for(std::string_view ext : context->mExtensions)
{
- if(al::strncasecmp(ptr, extName, len) == 0 && (ptr[len] == '\0' || isspace(ptr[len])))
+ if(len == ext.length() && al::strncasecmp(ext.data(), extName, len) == 0)
return AL_TRUE;
-
- if((ptr=strchr(ptr, ' ')) != nullptr)
- {
- do {
- ++ptr;
- } while(isspace(*ptr));
- }
}
return AL_FALSE;