mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 12:27:36 +00:00
Everywhere: Pass AK::ReadonlyBytes by value
This commit is contained in:
parent
8b1108e485
commit
80d4e830a0
42 changed files with 96 additions and 96 deletions
|
@ -143,7 +143,7 @@ void TarOutputStream::add_directory(const String& path, mode_t mode)
|
|||
VERIFY(m_stream.write_or_error(Bytes { &padding, block_size - sizeof(header) }));
|
||||
}
|
||||
|
||||
void TarOutputStream::add_file(const String& path, mode_t mode, const ReadonlyBytes& bytes)
|
||||
void TarOutputStream::add_file(const String& path, mode_t mode, ReadonlyBytes bytes)
|
||||
{
|
||||
VERIFY(!m_finished);
|
||||
TarFileHeader header;
|
||||
|
|
|
@ -53,7 +53,7 @@ private:
|
|||
class TarOutputStream {
|
||||
public:
|
||||
TarOutputStream(OutputStream&);
|
||||
void add_file(const String& path, mode_t, const ReadonlyBytes&);
|
||||
void add_file(const String& path, mode_t, ReadonlyBytes);
|
||||
void add_directory(const String& path, mode_t);
|
||||
void finish();
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Archive {
|
||||
|
||||
bool Zip::find_end_of_central_directory_offset(const ReadonlyBytes& buffer, size_t& offset)
|
||||
bool Zip::find_end_of_central_directory_offset(ReadonlyBytes buffer, size_t& offset)
|
||||
{
|
||||
for (size_t backwards_offset = 0; backwards_offset <= UINT16_MAX; backwards_offset++) // the file may have a trailing comment of an arbitrary 16 bit length
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ bool Zip::find_end_of_central_directory_offset(const ReadonlyBytes& buffer, size
|
|||
return false;
|
||||
}
|
||||
|
||||
Optional<Zip> Zip::try_create(const ReadonlyBytes& buffer)
|
||||
Optional<Zip> Zip::try_create(ReadonlyBytes buffer)
|
||||
{
|
||||
size_t end_of_central_directory_offset;
|
||||
if (!find_end_of_central_directory_offset(buffer, end_of_central_directory_offset))
|
||||
|
|
|
@ -207,11 +207,11 @@ struct ZipMember {
|
|||
|
||||
class Zip {
|
||||
public:
|
||||
static Optional<Zip> try_create(const ReadonlyBytes& buffer);
|
||||
static Optional<Zip> try_create(ReadonlyBytes buffer);
|
||||
bool for_each_member(Function<IterationDecision(const ZipMember&)>);
|
||||
|
||||
private:
|
||||
static bool find_end_of_central_directory_offset(const ReadonlyBytes&, size_t& offset);
|
||||
static bool find_end_of_central_directory_offset(ReadonlyBytes, size_t& offset);
|
||||
|
||||
u16 member_count { 0 };
|
||||
size_t members_start_offset { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue