10225501448 李度 10225101546 陈胤遒 10215501422 高宇菲
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

24 行
488 B

# ifndef SLICE_HASH_SET_H
# define SLICE_HASH_SET_H
#include "leveldb/slice.h"
#include "util/hash.h"
#include <unordered_set>
using namespace leveldb;
class SliceHash {
public:
uint32_t operator()(const Slice &lhs) const {
return Hash(lhs.data(),lhs.size(),0x1234);
}
};
class SliceEq {
public:
bool operator()(const Slice &lhs, const Slice &rhs) const {
return lhs == rhs;
}
};
using SliceHashSet = std::unordered_set<Slice,SliceHash,SliceEq>;
#endif