Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/tscore/HashFNV.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ struct ATSHash32FNV1a : ATSHash32 {
void clear() override;

private:
uint32_t hval;
static constexpr uint32_t fnv_init = 0x811c9dc5u;
uint32_t hval{fnv_init};
};

template <typename Transform>
Expand Down Expand Up @@ -76,7 +77,8 @@ struct ATSHash64FNV1a : ATSHash64 {
void clear() override;

private:
uint64_t hval;
static constexpr uint64_t fnv_init = 0xcbf29ce484222325ull;
uint64_t hval{fnv_init};
};

template <typename Transform>
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/http3/Http3Frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ Http3FrameFactory::create(IOBufferReader &reader)
ts::Http3Config::scoped_config params;
Http3Frame *frame = nullptr;

uint8_t type_buf[FRAME_TYPE_MAX_BYTES];
uint8_t type_buf[FRAME_TYPE_MAX_BYTES]{};
reader.memcpy(type_buf, sizeof(type_buf));
Http3FrameType type = Http3Frame::type(type_buf, sizeof(type_buf));
Comment on lines 509 to 510
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will need some help to see if this comment makes sense or not.
Otherwise I think we can ignore it for now.


Expand Down
19 changes: 5 additions & 14 deletions src/tscore/HashFNV.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@

#include "tscore/HashFNV.h"

static const uint32_t FNV_INIT_32 = 0x811c9dc5u;
static const uint64_t FNV_INIT_64 = 0xcbf29ce484222325ull;

// FNV-1a 64bit
ATSHash32FNV1a::ATSHash32FNV1a()
{
this->clear();
}
// FNV-1a 32bit
ATSHash32FNV1a::ATSHash32FNV1a() = default;

void
ATSHash32FNV1a::final()
Expand All @@ -32,14 +26,11 @@ ATSHash32FNV1a::get() const
void
ATSHash32FNV1a::clear()
{
hval = FNV_INIT_32;
hval = fnv_init;
}

// FNV-1a 64bit
ATSHash64FNV1a::ATSHash64FNV1a()
{
this->clear();
}
ATSHash64FNV1a::ATSHash64FNV1a() = default;
void
ATSHash64FNV1a::final()
{
Expand All @@ -54,5 +45,5 @@ ATSHash64FNV1a::get() const
void
ATSHash64FNV1a::clear()
{
hval = FNV_INIT_64;
hval = fnv_init;
}