db/upnp/Device: use ContentDirectoryDescriptor's move operator
Reduce bloat.
This commit is contained in:
parent
be0759d465
commit
04b7648e00
|
@ -85,6 +85,10 @@ public:
|
|||
UPnPDevice(const std::string &url, const char *description);
|
||||
|
||||
UPnPDevice() : ok(false) {}
|
||||
|
||||
UPnPDevice(const UPnPDevice &) = delete;
|
||||
UPnPDevice(UPnPDevice &&) = default;
|
||||
UPnPDevice &operator=(UPnPDevice &&) = default;
|
||||
};
|
||||
|
||||
#endif /* _UPNPDEV_HXX_INCLUDED_ */
|
||||
|
|
|
@ -82,13 +82,7 @@ UPnPDeviceDirectory::discoExplorer()
|
|||
}
|
||||
|
||||
const ScopeLock protect(mutex);
|
||||
#if defined(__clang__) || GCC_CHECK_VERSION(4,8)
|
||||
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;
|
||||
directories[std::move(tsk->deviceId)] = std::move(d);
|
||||
|
||||
delete tsk;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,8 @@ class UPnPDeviceDirectory {
|
|||
*/
|
||||
class ContentDirectoryDescriptor {
|
||||
public:
|
||||
ContentDirectoryDescriptor() = default;
|
||||
|
||||
ContentDirectoryDescriptor(const std::string &url,
|
||||
const char *description,
|
||||
time_t last, int exp)
|
||||
|
|
Loading…
Reference in New Issue