Get rid of StreamBuffer::read_entire_contents and StreamBuffer::hash

This commit is contained in:
2023-10-18 14:32:12 -04:00
parent 3e8aa31a95
commit 6c2a27b274
4 changed files with 2 additions and 22 deletions

View File

@@ -227,12 +227,6 @@ util::HashValue StreamBuffer::read_hashvalue() {
return util::HashValue(f,s);
}
eng::string StreamBuffer::read_entire_contents() {
eng::string result(read_cursor_, fill());
read_cursor_ = write_cursor_;
return result;
}
void StreamBuffer::overwrite_int8(int64_t write_count_after, int64_t vv) {
int8_t v = vv;
assert(int64_t(v) == vv);
@@ -328,13 +322,6 @@ bool StreamBuffer::contents_equal(const StreamBuffer *other) const {
return memcmp(read_cursor_, other->read_cursor_, len) == 0;
}
util::HashValue StreamBuffer::hash() const {
uint64_t hash1 = 0x82A7912E7893AC87;
uint64_t hash2 = 0x81D402740DE458F3;
SpookyHash::ChainHash128(read_cursor_, write_cursor_ - read_cursor_, &hash1, &hash2);
return std::make_pair(hash1, hash2);
}
int lua_writer_into_streambuffer(lua_State *L, const void* bytes, size_t sz, void* sbv) {
StreamBuffer *sb = (StreamBuffer *)sbv;
memcpy(sb->make_space(sz), bytes, sz);