From 1361d7d36aca930f621ac1f5a68aae515eb6a28d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jul 2024 20:46:41 +0200 Subject: remove last usages --- editor/vobj-editor.cpp | 6 +++--- editor/vobj-editor.hpp | 4 ++-- test/hash.cpp | 4 ++-- test/json.cpp | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/editor/vobj-editor.cpp b/editor/vobj-editor.cpp index cab9c0e1..6dc8c907 100644 --- a/editor/vobj-editor.cpp +++ b/editor/vobj-editor.cpp @@ -128,13 +128,13 @@ bptr hole_factory::make(world& w, object_id id, global_coords pos) const auto vobj_editor::make_vobj_type_map() -> std::map { - constexpr auto add = [](auto& m, std::unique_ptr&& x) { + constexpr auto add = [](auto& m, Pointer&& x) { StringView name = x->name(), descr = x->descr(); m[name] = vobj_editor::vobj_{ name, descr, move(x) }; }; std::map map; - add(map, std::make_unique()); - add(map, std::make_unique()); + add(map, Pointer{InPlace}); + add(map, Pointer{InPlace}); return map; } diff --git a/editor/vobj-editor.hpp b/editor/vobj-editor.hpp index c614b4e7..0c6d8fcd 100644 --- a/editor/vobj-editor.hpp +++ b/editor/vobj-editor.hpp @@ -2,9 +2,9 @@ #include "src/object-type.hpp" #include "src/object-id.hpp" #include "compat/borrowed-ptr-fwd.hpp" -#include #include #include +#include namespace floormat { @@ -33,7 +33,7 @@ class vobj_editor final public: struct vobj_ final { String name, descr; - std::unique_ptr factory; + Pointer factory; }; vobj_editor(); diff --git a/test/hash.cpp b/test/hash.cpp index 2c6a7516..7582db43 100644 --- a/test/hash.cpp +++ b/test/hash.cpp @@ -4,8 +4,8 @@ #include "src/global-coords.hpp" #include "src/world.hpp" #include +#include #include -#include #include #ifdef __GNUG__ @@ -49,7 +49,7 @@ template constexpr size_t Iters = (CoordMax*2 + 1)*(CoordMax*2 + 1)*(1+ZMax); // NOLINT(*-implicit-widening-of-multiplication-result) constexpr size_t BucketCount = Math::max(world::initial_capacity, size_t(Math::ceil(Iters / 0.2f))); uint32_t num_collisions = 0, iters = 0; - auto bitset_ = std::make_unique>(false); + auto bitset_ = Pointer>{InPlace, false}; auto& bitset = *bitset_; for (int16_t j = -CoordMax; j <= CoordMax; j++) diff --git a/test/json.cpp b/test/json.cpp index e9ed166f..c075d99c 100644 --- a/test/json.cpp +++ b/test/json.cpp @@ -9,7 +9,6 @@ #include "src/world.hpp" #include "loader/loader.hpp" #include "loader/wall-cell.hpp" -#include #include #include -- cgit v1.2.3