Skip to content

Commit d7389de

Browse files
committed
Change a method name (getLoopNum() -> size())
1 parent 3d289c3 commit d7389de

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

trantor/net/EventLoopThreadPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class EventLoopThreadPool : NonCopyable
2929
void start();
3030
// void stop();
3131
void wait();
32-
size_t getLoopNum()
32+
size_t size()
3333
{
3434
return loopThreadVector_.size();
3535
}

trantor/net/TcpServer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void TcpServer::newConnection(int sockfd, const InetAddress &peer)
5858
// LOG_TRACE<<"write "<<n<<" bytes";
5959
loop_->assertInLoopThread();
6060
EventLoop *ioLoop = NULL;
61-
if (loopPoolPtr_ && loopPoolPtr_->getLoopNum() > 0)
61+
if (loopPoolPtr_ && loopPoolPtr_->size() > 0)
6262
{
6363
ioLoop = loopPoolPtr_->getNextLoop();
6464
}
@@ -122,7 +122,7 @@ void TcpServer::start()
122122
: 100);
123123
if (loopPoolPtr_)
124124
{
125-
auto loopNum = loopPoolPtr_->getLoopNum();
125+
auto loopNum = loopPoolPtr_->size();
126126
while (loopNum > 0)
127127
{
128128
// LOG_TRACE << "new Wheel loopNum=" << loopNum;

trantor/net/TcpServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class TcpServer : NonCopyable
4747
}
4848
void setIoLoopThreadPool(const std::shared_ptr<EventLoopThreadPool> &pool)
4949
{
50-
assert(pool->getLoopNum() > 0);
50+
assert(pool->size() > 0);
5151
assert(!started_);
5252
loopPoolPtr_ = pool;
5353
loopPoolPtr_->start();

0 commit comments

Comments
 (0)