Removes redundant null pointer checks checks
pull/1249/head
Joshua Haberman 9 years ago
commit d41db75dcb
  1. 2
      src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc
  2. 4
      src/google/protobuf/io/gzip_stream.cc

@ -107,7 +107,7 @@ class MockGeneratorContext : public GeneratorContext {
virtual io::ZeroCopyOutputStream* Open(const string& filename) { virtual io::ZeroCopyOutputStream* Open(const string& filename) {
string** map_slot = &files_[filename]; string** map_slot = &files_[filename];
if (*map_slot != NULL) delete *map_slot; delete *map_slot;
*map_slot = new string; *map_slot = new string;
return new io::StringOutputStream(*map_slot); return new io::StringOutputStream(*map_slot);

@ -241,9 +241,7 @@ void GzipOutputStream::Init(ZeroCopyOutputStream* sub_stream,
GzipOutputStream::~GzipOutputStream() { GzipOutputStream::~GzipOutputStream() {
Close(); Close();
if (input_buffer_ != NULL) { operator delete(input_buffer_);
operator delete(input_buffer_);
}
} }
// private // private

Loading…
Cancel
Save