Explorar o código

Removal of null check

Removed the redundant check for NULL which is already correctly handled
by used the delete
eissajamil@gmail.com %!s(int64=10) %!d(string=hai) anos
pai
achega
a1c5e45db3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc

+ 1 - 1
src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc

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