Skip to content

Commit 536e997

Browse files
committed
Remove assert in vector rep
Summary: This assert makes Insert O(n^2) instead of O(n) in debug mode. Memtable insert is in the critical path. No need to assert uniqunnes of the key here, since we're adding a sequence number to it anyway. Test Plan: none Reviewers: sdong, ljin Reviewed By: ljin Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D22443
1 parent 4142a3e commit 536e997

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

util/vectorrep.cc

-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class VectorRep : public MemTableRep {
106106

107107
void VectorRep::Insert(KeyHandle handle) {
108108
auto* key = static_cast<char*>(handle);
109-
assert(!Contains(key));
110109
WriteLock l(&rwlock_);
111110
assert(!immutable_);
112111
bucket_->push_back(key);

0 commit comments

Comments
 (0)