From 1f50cd6ac3aaa47fdf26bb509b455ac7ed8ef7fe Mon Sep 17 00:00:00 2001 From: mutouyun Date: Thu, 22 Nov 2018 17:01:20 +0800 Subject: [PATCH] optimized code --- src/circ_queue.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/circ_queue.h b/src/circ_queue.h index 77598f6..f7f0755 100644 --- a/src/circ_queue.h +++ b/src/circ_queue.h @@ -53,10 +53,7 @@ private: public: static std::uint16_t next(std::uint16_t i) { - if (id(++i) == elem_max) { - return ++i; - } - else return i; + return (id(++i) == elem_max) ? 0 : i; } circ_queue(void) {