From 690bd3b20da94ce8a3a30d7cffe54cdce10d19ef Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sat, 9 Sep 2017 22:29:19 +0200 Subject: [PATCH] Remove useless assignments. --- src/instr/instr_paje_types.cpp | 9 ++------- src/smpi/bindings/smpi_pmpi_request.cpp | 6 ++---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 8dd65cfd34..2ee897097a 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -58,7 +58,6 @@ void PJ_type_free(simgrid::instr::Type* type) xbt_free(type->color_); xbt_dict_free(&type->children_); delete type; - type = nullptr; } void recursiveDestroyType(simgrid::instr::Type* type) @@ -158,11 +157,9 @@ simgrid::instr::Type* simgrid::instr::Type::linkNew(const char* name, Type* fath THROWF (tracing_error, 0, "can't create a link type with a nullptr name"); } - Type* ret = nullptr; - char key[INSTR_DEFAULT_STR_SIZE]; snprintf(key, INSTR_DEFAULT_STR_SIZE, "%s-%s-%s", name, source->id_, dest->id_); - ret = new Type (name, key, nullptr, TYPE_LINK, father); + Type* ret = new Type(name, key, nullptr, TYPE_LINK, father); XBT_DEBUG("LinkType %s(%s), child of %s(%s) %s(%s)->%s(%s)", ret->name_, ret->id_, father->name_, father->id_, source->name_, source->id_, dest->name_, dest->id_); LogLinkTypeDefinition(ret, source, dest); @@ -175,9 +172,7 @@ simgrid::instr::Type* simgrid::instr::Type::stateNew(const char* name, Type* fat THROWF (tracing_error, 0, "can't create a state type with a nullptr name"); } - Type* ret = nullptr; - - ret = new Type (name, name, nullptr, TYPE_STATE, father); + Type* ret = new Type(name, name, nullptr, TYPE_STATE, father); XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->name_, ret->id_, father->name_, father->id_); LogStateTypeDefinition(ret); return ret; diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index c8ef0ec622..ab3091bde6 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -645,7 +645,7 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta { if (index == nullptr) return MPI_ERR_ARG; - + if (count <= 0) return MPI_SUCCESS; @@ -658,9 +658,7 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta int tag; MPI_Comm comm; } savedvalstype; - savedvalstype* savedvals=nullptr; - - savedvals = xbt_new0(savedvalstype, count); + savedvalstype* savedvals = xbt_new0(savedvalstype, count); for (int i = 0; i < count; i++) { MPI_Request req = requests[i]; //already received requests are no longer valid -- 2.20.1