10225501448 李度 10225101546 陈胤遒 10215501422 高宇菲
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
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