优化代码

空构造和析构函数替换为缺省
去除多余分号
This commit is contained in:
xiongziliang
2023-04-22 21:59:26 +08:00
parent e8a425945d
commit 7a95c87a29
21 changed files with 50 additions and 57 deletions

View File

@@ -27,8 +27,8 @@ class HttpCookie {
public:
using Ptr = std::shared_ptr<HttpCookie>;
friend class HttpCookieStorage;
HttpCookie(){}
~HttpCookie(){}
HttpCookie() = default;
~HttpCookie() = default;
void setPath(const std::string &path);
void setHost(const std::string &host);
@@ -52,12 +52,14 @@ private:
*/
class HttpCookieStorage{
public:
~HttpCookieStorage(){}
~HttpCookieStorage() = default;
static HttpCookieStorage &Instance();
void set(const HttpCookie::Ptr &cookie);
std::vector<HttpCookie::Ptr> get(const std::string &host,const std::string &path);
private:
HttpCookieStorage(){};
HttpCookieStorage() = default;
private:
std::unordered_map<std::string/*host*/, std::map<std::string/*cookie path*/,std::map<std::string/*cookie_key*/, HttpCookie::Ptr> > > _all_cookie;
std::mutex _mtx_cookie;