Skip to content

Commit

Permalink
🎨 change shared_ptr to unique_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
markparticle committed Jun 28, 2020
1 parent 25de139 commit 7993be2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions code/http/httpconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ class HttpConn {
static std::atomic<int> userCount;

private:
static const int PATH_LEN = 200;
static const int READ_BUFF_SIZE = 5000;
static const int WRITE_BUFF_SIZE = 1024;

int fd_;
struct sockaddr_in addr_;

Expand Down
1 change: 0 additions & 1 deletion code/pool/threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class ThreadPool {
pool_->cond.notify_all();
}


private:
struct Pool {
std::mutex mtx;
Expand Down
4 changes: 2 additions & 2 deletions code/server/webserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class WebServer {
uint32_t connEvent_;

std::unique_ptr<HeapTimer> timer_;
std::shared_ptr<ThreadPool> threadpool_;
std::shared_ptr<Epoller> epoller_;
std::unique_ptr<ThreadPool> threadpool_;
std::unique_ptr<Epoller> epoller_;
std::unordered_map<int, HttpConn> users_;

};
Expand Down

0 comments on commit 7993be2

Please sign in to comment.