From 1758f76f2d173a188436c7cac80decc8452b643e Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Fri, 24 Apr 2020 15:11:42 -0700 Subject: [PATCH] Fix unused variable of r in release mode (#6750) Summary: In release mode, asserts are not compiled, so `r` is not used, causing compiler warnings. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6750 Test Plan: make check under release mode Reviewed By: anand1976 Differential Revision: D21220365 Pulled By: cheng-chang fbshipit-source-id: fd4afa9843d54af68c4da8660ec61549803e1167 --- env/io_posix.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/env/io_posix.cc b/env/io_posix.cc index 1937548a0..ba4ee15ef 100644 --- a/env/io_posix.cc +++ b/env/io_posix.cc @@ -610,10 +610,9 @@ IOStatus PosixRandomAccessFile::MultiRead(FSReadRequest* reqs, IODebugContext* dbg) { if (use_direct_io()) { for (size_t i = 0; i < num_reqs; i++) { - const FSReadRequest& r = reqs[i]; - assert(IsSectorAligned(r.offset, GetRequiredBufferAlignment())); - assert(IsSectorAligned(r.len, GetRequiredBufferAlignment())); - assert(IsSectorAligned(r.scratch, GetRequiredBufferAlignment())); + assert(IsSectorAligned(reqs[i].offset, GetRequiredBufferAlignment())); + assert(IsSectorAligned(reqs[i].len, GetRequiredBufferAlignment())); + assert(IsSectorAligned(reqs[i].scratch, GetRequiredBufferAlignment())); } }