From 769987ca33a2a695e7b132447f00a8c4a2829047 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 30 Jan 2015 02:34:33 -0500 Subject: [PATCH] unique_ptr is a better fit here --- zone/map.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zone/map.cpp b/zone/map.cpp index 41751028b..d4bb5a268 100644 --- a/zone/map.cpp +++ b/zone/map.cpp @@ -413,9 +413,9 @@ bool Map::LoadV2(FILE *f) { buf += sizeof(uint32); } - std::map> models; + std::map> models; for (uint32 i = 0; i < model_count; ++i) { - std::shared_ptr me(new ModelEntry); + std::unique_ptr me(new ModelEntry); std::string name = buf; buf += name.length() + 1; @@ -456,7 +456,7 @@ bool Map::LoadV2(FILE *f) { me->polys[j] = p; } - models[name] = me; + models[name] = std::move(me); } for (uint32 i = 0; i < plac_count; ++i) { @@ -487,7 +487,7 @@ bool Map::LoadV2(FILE *f) { if (models.count(name) == 0) continue; - auto model = models[name]; + auto &model = models[name]; auto &mod_polys = model->polys; auto &mod_verts = model->verts; for (uint32 j = 0; j < mod_polys.size(); ++j) {