key_ cannot become nullptr, so no check is needed for that

(ignoring the unlikely case that some overrides
`operator new throw(std::bad_alloc)` with a function that returns a nullptr)
This commit is contained in:
jsteemann 2015-09-18 20:15:20 +02:00
parent 834b12a8d5
commit 5ec129971b

View File

@ -302,7 +302,7 @@ class IterKey {
char* p = new char[total_size];
memcpy(p, key_, shared_len);
if (key_ != nullptr && key_ != space_) {
if (key_ != space_) {
delete[] key_;
}
@ -388,10 +388,10 @@ class IterKey {
char space_[32]; // Avoid allocation for short keys
void ResetBuffer() {
if (key_ != nullptr && key_ != space_) {
if (key_ != space_) {
delete[] key_;
key_ = space_;
}
key_ = space_;
buf_size_ = sizeof(space_);
key_size_ = 0;
}