]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
include/interval_set: no need to check if an unsigned greater or equal to 0
authorKefu Chai <kchai@redhat.com>
Fri, 22 May 2020 10:04:26 +0000 (18:04 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 27 May 2020 04:35:11 +0000 (12:35 +0800)
this silences the warning of

../src/include/interval_set.h:512:23: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
  512 |     ceph_assert(_size >= 0);

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/include/interval_set.h

index 5b2b90d87ac1bab6c783729a8211bfd119ad27fc..3090ef9570f55f68a775df47800236a981b18c41 100644 (file)
@@ -509,7 +509,6 @@ class interval_set {
   
   void erase(iterator &i) {
     _size -= i.get_len();
-    ceph_assert(_size >= 0);
     m.erase(i._iter);
   }
 
@@ -522,7 +521,6 @@ class interval_set {
     auto p = find_inc_m(start);
 
     _size -= len;
-    ceph_assert(_size >= 0);
 
     ceph_assert(p != m.end());
     ceph_assert(p->first <= start);