From 22bb91ef38e00776ea7704589d943b7ccac1f2d1 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Wed, 11 Oct 2017 13:08:07 +1100 Subject: [PATCH] AI/Lua Object: deployed more std::make_shared --- src/ai/lua/lua_object.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ai/lua/lua_object.hpp b/src/ai/lua/lua_object.hpp index 16f393f9d65ef..ebea103aee64b 100644 --- a/src/ai/lua/lua_object.hpp +++ b/src/ai/lua/lua_object.hpp @@ -84,25 +84,25 @@ class lua_object : public lua_object_base template <> inline std::shared_ptr lua_object::to_type(lua_State *L, int n) { - return std::shared_ptr(new double(lua_tonumber(L, n))); + return std::make_shared(lua_tonumber(L, n)); } template <> inline std::shared_ptr lua_object::to_type(lua_State *L, int n) { - return std::shared_ptr(new std::string(lua_tostring(L, n))); + return std::make_shared(lua_tostring(L, n)); } template <> inline std::shared_ptr lua_object::to_type(lua_State *L, int n) { - return std::shared_ptr(new bool(luaW_toboolean(L, n))); + return std::make_shared(luaW_toboolean(L, n)); } template <> inline std::shared_ptr lua_object::to_type(lua_State *L, int n) { - return std::shared_ptr(new int(static_cast(lua_tointeger(L, n)))); + return std::make_shared(static_cast(lua_tointeger(L, n))); } template <>