diff options
author | Chris Robinson <[email protected]> | 2023-05-08 14:47:19 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-08 14:47:19 -0700 |
commit | e42681c4472b8a149a8f1e68614e4f5ee5d04fb0 (patch) | |
tree | cc01c5aeddf58f56d0a82f065ff9265fa7dd5661 /al/extension.cpp | |
parent | 755a6e15b5665914a6d67157abc1060746e658b0 (diff) |
Store extension strings individually
And dynamically build the full AL_EXTENSIONS string
Diffstat (limited to 'al/extension.cpp')
-rw-r--r-- | al/extension.cpp | 12 |
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; |