db/upnp/Device: use ContentDirectoryDescriptor's move operator

Reduce bloat.
This commit is contained in:
Max Kellermann 2014-01-18 13:53:29 +01:00
parent be0759d465
commit 04b7648e00
3 changed files with 7 additions and 7 deletions

View File

@ -85,6 +85,10 @@ public:
UPnPDevice(const std::string &url, const char *description); UPnPDevice(const std::string &url, const char *description);
UPnPDevice() : ok(false) {} UPnPDevice() : ok(false) {}
UPnPDevice(const UPnPDevice &) = delete;
UPnPDevice(UPnPDevice &&) = default;
UPnPDevice &operator=(UPnPDevice &&) = default;
}; };
#endif /* _UPNPDEV_HXX_INCLUDED_ */ #endif /* _UPNPDEV_HXX_INCLUDED_ */

View File

@ -82,13 +82,7 @@ UPnPDeviceDirectory::discoExplorer()
} }
const ScopeLock protect(mutex); const ScopeLock protect(mutex);
#if defined(__clang__) || GCC_CHECK_VERSION(4,8) directories[std::move(tsk->deviceId)] = std::move(d);
auto e = directories.emplace(tsk->deviceId, d);
#else
auto e = directories.insert(std::make_pair(tsk->deviceId, d));
#endif
if (!e.second)
e.first->second = d;
delete tsk; delete tsk;
} }

View File

@ -65,6 +65,8 @@ class UPnPDeviceDirectory {
*/ */
class ContentDirectoryDescriptor { class ContentDirectoryDescriptor {
public: public:
ContentDirectoryDescriptor() = default;
ContentDirectoryDescriptor(const std::string &url, ContentDirectoryDescriptor(const std::string &url,
const char *description, const char *description,
time_t last, int exp) time_t last, int exp)