1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 14:17:34 +00:00

Everywhere: Pass AK::StringView by value

This commit is contained in:
Andreas Kling 2021-11-11 00:55:02 +01:00
parent ad5d217e76
commit 8b1108e485
392 changed files with 978 additions and 978 deletions

View file

@ -73,7 +73,7 @@ String type_name(Type type)
return "InvalidType";
}
Optional<Core::DateTime> parse_utc_time(const StringView& time)
Optional<Core::DateTime> parse_utc_time(StringView time)
{
// YYMMDDhhmm[ss]Z or YYMMDDhhmm[ss](+|-)hhmm
GenericLexer lexer(time);
@ -120,7 +120,7 @@ Optional<Core::DateTime> parse_utc_time(const StringView& time)
return Core::DateTime::create(full_year, month.value(), day.value(), hour.value(), minute.value(), full_seconds);
}
Optional<Core::DateTime> parse_generalized_time(const StringView& time)
Optional<Core::DateTime> parse_generalized_time(StringView time)
{
// YYYYMMDDhh[mm[ss[.fff]]] or YYYYMMDDhh[mm[ss[.fff]]]Z or YYYYMMDDhh[mm[ss[.fff]]](+|-)hhmm
GenericLexer lexer(time);

View file

@ -52,7 +52,7 @@ String kind_name(Kind);
String class_name(Class);
String type_name(Type);
Optional<Core::DateTime> parse_utc_time(const StringView&);
Optional<Core::DateTime> parse_generalized_time(const StringView&);
Optional<Core::DateTime> parse_utc_time(StringView);
Optional<Core::DateTime> parse_generalized_time(StringView);
}

View file

@ -49,10 +49,10 @@ public:
}
TagType process(ReadonlyBytes span) { return process(span.data(), span.size()); }
TagType process(const StringView& string) { return process((const u8*)string.characters_without_null_termination(), string.length()); }
TagType process(StringView string) { return process((const u8*)string.characters_without_null_termination(), string.length()); }
void update(ReadonlyBytes span) { return update(span.data(), span.size()); }
void update(const StringView& string) { return update((const u8*)string.characters_without_null_termination(), string.length()); }
void update(StringView string) { return update((const u8*)string.characters_without_null_termination(), string.length()); }
TagType digest()
{
@ -110,7 +110,7 @@ private:
}
void derive_key(ReadonlyBytes key) { derive_key(key.data(), key.size()); }
void derive_key(const StringView& key) { derive_key(key.bytes()); }
void derive_key(StringView key) { derive_key(key.bytes()); }
HashType m_inner_hasher, m_outer_hasher;
u8 m_key_data[2048];

View file

@ -44,7 +44,7 @@ public:
return { UnsignedBigInteger::create_invalid(), false };
}
static SignedBigInteger import_data(const StringView& data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); }
static SignedBigInteger import_data(StringView data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); }
static SignedBigInteger import_data(const u8* ptr, size_t length);
static SignedBigInteger create_from(i64 value)

View file

@ -35,7 +35,7 @@ public:
static UnsignedBigInteger create_invalid();
static UnsignedBigInteger import_data(const StringView& data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); }
static UnsignedBigInteger import_data(StringView data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); }
static UnsignedBigInteger import_data(const u8* ptr, size_t length)
{
return UnsignedBigInteger(ptr, length);

View file

@ -29,7 +29,7 @@ public:
void update(const Bytes& buffer) { update(buffer.data(), buffer.size()); };
void update(const ReadonlyBytes& buffer) { update(buffer.data(), buffer.size()); };
void update(const ByteBuffer& buffer) { update(buffer.data(), buffer.size()); };
void update(const StringView& string) { update((const u8*)string.characters_without_null_termination(), string.length()); };
void update(StringView string) { update((const u8*)string.characters_without_null_termination(), string.length()); };
virtual DigestType peek() = 0;
virtual DigestType digest() = 0;

View file

@ -71,7 +71,7 @@ public:
}
inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(const StringView& buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
inline virtual void reset() override
{
m_A = MD5Constants::init_A;

View file

@ -56,7 +56,7 @@ public:
}
inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(const StringView& buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
virtual String class_name() const override
{

View file

@ -103,7 +103,7 @@ public:
}
inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(const StringView& buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
virtual String class_name() const override
{
@ -153,7 +153,7 @@ public:
}
inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(const StringView& buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
virtual String class_name() const override
{
@ -203,7 +203,7 @@ public:
}
inline static DigestType hash(const ByteBuffer& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(const StringView& buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
inline static DigestType hash(StringView buffer) { return hash((const u8*)buffer.characters_without_null_termination(), buffer.length()); }
virtual String class_name() const override
{

View file

@ -141,7 +141,7 @@ public:
import_private_key(privateKeyPEM);
}
RSA(const StringView& privKeyPEM)
RSA(StringView privKeyPEM)
{
import_private_key(privKeyPEM.bytes());
m_public_key.set(m_private_key.modulus(), m_private_key.public_exponent());