mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:57:35 +00:00
LibWeb: Use StringView in CSS::PreferredColorScheme
This doesn't need to hold the string data.
This commit is contained in:
parent
dca19b764b
commit
316092d185
2 changed files with 4 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
PreferredColorScheme preferred_color_scheme_from_string(DeprecatedString const& value)
|
||||
PreferredColorScheme preferred_color_scheme_from_string(StringView value)
|
||||
{
|
||||
if (value.equals_ignoring_case("light"sv))
|
||||
return PreferredColorScheme::Light;
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
@ -17,7 +16,7 @@ enum class PreferredColorScheme {
|
|||
Light,
|
||||
};
|
||||
|
||||
PreferredColorScheme preferred_color_scheme_from_string(DeprecatedString const&);
|
||||
PreferredColorScheme preferred_color_scheme_from_string(StringView);
|
||||
StringView preferred_color_scheme_to_string(PreferredColorScheme);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue