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(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_ */
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue