From 65a9e01a8fa6f3ea1aa94cff15938d5cdaebb8fe Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Mon, 25 Apr 2022 10:27:46 +0800 Subject: [PATCH] Use AssertInfo instead of assert to ensure compiling (#16533) Signed-off-by: zhenshan.cao --- internal/core/src/common/BitsetView.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/core/src/common/BitsetView.h b/internal/core/src/common/BitsetView.h index a5ab535a2d..0a1a370b52 100644 --- a/internal/core/src/common/BitsetView.h +++ b/internal/core/src/common/BitsetView.h @@ -18,7 +18,7 @@ #include #include - +#include "exceptions/EasyAssert.h" #include "common/Types.h" #include "knowhere/utils/BitsetView.h" @@ -50,8 +50,9 @@ class BitsetView : public faiss::BitsetView { if (empty()) { return BitsetView(); } - assert((offset & 0x7) == 0); - assert((offset + size) <= this->size()); + + AssertInfo((offset & 0x7) == 0, "offset is not divisible by 8"); + AssertInfo((offset + size) <= this->size(), "offset + size cross the border."); return BitsetView(data() + (offset >> 3), size); } };