cukiernik commented on a change in pull request #7818:
URL: https://github.com/apache/trafficserver/pull/7818#discussion_r633319135



##########
File path: iocore/aio/AIO.cc
##########
@@ -379,18 +379,15 @@ aio_queue_req(AIOCallbackInternal *op, int fromAPI = 0)
 static inline int
 cache_op(AIOCallbackInternal *op)
 {
-  bool read = (op->aiocb.aio_lio_opcode == LIO_READ);
+  using ActionFunc = decltype(&pread);
+  ActionFunc action = op->aiocb.aio_lio_opcode == LIO_READ ? &pread : 
reinterpret_cast<ActionFunc>(&pwrite);

Review comment:
       I know that this is a negligible optimization. Actually, I have not 
encountered a case where the loop was repeated more than 4 times. 
   This is an part of a new functionality at the Cache module. I prefer push a 
independent part of a code, before main commit, to simplification and reduce 
size of a main commit.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to