From: Martin Kronbichler Date: Sun, 29 Apr 2018 11:06:22 +0000 (+0200) Subject: Prefer emplace_back over push_back in a few places. X-Git-Tag: v9.0.0-rc1~72^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6386%2Fhead;p=dealii.git Prefer emplace_back over push_back in a few places. --- diff --git a/include/deal.II/matrix_free/face_setup_internal.h b/include/deal.II/matrix_free/face_setup_internal.h index 368364ca4a..47d1636529 100644 --- a/include/deal.II/matrix_free/face_setup_internal.h +++ b/include/deal.II/matrix_free/face_setup_internal.h @@ -244,12 +244,12 @@ namespace internal // involved, so both processors will generate the same // list that we will later order const CellId id_neigh = neighbor->id(); - inner_faces_at_proc_boundary[neigh_domain].shared_faces. - push_back(my_domain < neigh_domain - ? - std::make_pair(id_mine, id_neigh) - : - std::make_pair(id_neigh, id_mine)); + if (my_domain < neigh_domain) + inner_faces_at_proc_boundary[neigh_domain].shared_faces. + emplace_back(id_mine, id_neigh); + else + inner_faces_at_proc_boundary[neigh_domain].shared_faces. + emplace_back(id_neigh, id_mine); } } } @@ -801,10 +801,10 @@ namespace internal } info.face_orientation = 0; - unsigned int left_face_orientation = + const unsigned int left_face_orientation = !cell->face_orientation(face_no) + 2 * cell->face_flip(face_no) + 4 * cell->face_rotation(face_no); - unsigned int right_face_orientation = + const unsigned int right_face_orientation = !neighbor->face_orientation(info.exterior_face_no) + 2 * neighbor->face_flip(info.exterior_face_no) + 4 * neighbor->face_rotation(info.exterior_face_no); @@ -927,7 +927,7 @@ namespace internal goto face_found; } } - faces_type.push_back(std::vector(1, face)); + faces_type.emplace_back(1, face); face_found : {} }