ywkaras commented on a change in pull request #7818:
URL: https://github.com/apache/trafficserver/pull/7818#discussion_r632156080
##########
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);
+ typedef ssize_t (*p)(int, void*, size_t, __off_t);
+ p action=(op->aiocb.aio_lio_opcode == LIO_READ)?pread:(p)pwrite;
for (; op; op = (AIOCallbackInternal *)op->then) {
Review comment:
Try something like this (double dog dare ya):
https://godbolt.org/z/WGqK1czWK .
Your version of the template function would take ink_aiocb * a and ssize_t
res as parameters.
--
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]