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); } };