util/UriQueryParser: use std::string_view
This commit is contained in:
@@ -35,10 +35,8 @@ IcyInputStream::IcyInputStream(InputStreamPtr _input,
|
||||
if (fragment != nullptr) {
|
||||
const auto charset = UriFindRawQueryParameter(fragment,
|
||||
"charset");
|
||||
if (charset != nullptr) {
|
||||
const std::string copy(charset.data, charset.size);
|
||||
parser->SetCharset(copy.c_str());
|
||||
}
|
||||
if (charset.data() != nullptr)
|
||||
parser->SetCharset(std::string{charset}.c_str());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -195,11 +195,10 @@ CreateIcuConverterForUri(const char *uri)
|
||||
return nullptr;
|
||||
|
||||
const auto charset = UriFindRawQueryParameter(fragment, "charset");
|
||||
if (charset == nullptr)
|
||||
if (charset.data() == nullptr)
|
||||
return nullptr;
|
||||
|
||||
const std::string copy(charset.data, charset.size);
|
||||
return IcuConverter::Create(copy.c_str());
|
||||
return IcuConverter::Create(std::string{charset}.c_str());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user