LibURL: Migrate Origin scheme from ByteString to String

This commit is contained in:
Sam Atkins 2024-11-27 16:18:42 +00:00 committed by Andreas Kling
commit 2e64e0b836
Notes: github-actions[bot] 2024-11-30 11:23:49 +00:00
6 changed files with 10 additions and 13 deletions

View file

@ -18,7 +18,7 @@ String Origin::serialize() const
// 2. Otherwise, let result be origin's scheme.
StringBuilder result;
result.append(scheme());
result.append(scheme().value_or(String {}));
// 3. Append "://" to result.
result.append("://"sv);
@ -45,7 +45,7 @@ unsigned Traits<URL::Origin>::hash(URL::Origin const& origin)
if (origin.is_opaque())
return 0;
unsigned hash = origin.scheme().hash();
unsigned hash = origin.scheme().value_or(String {}).hash();
if (origin.port().has_value())
hash = pair_int_hash(hash, *origin.port());