Browse Source

Merge branch 'fix-map'

greatbridf 2 years ago
parent
commit
39430cb4c3
1 changed files with 5 additions and 3 deletions
  1. 5 3
      include/types/map.hpp

+ 5 - 3
include/types/map.hpp

@@ -386,7 +386,7 @@ public:
             return ret;
         }
 
-        constexpr operator bool(void)
+        explicit constexpr operator bool(void)
         {
             return p;
         }
@@ -575,8 +575,10 @@ private:
                 }
             } else {
                 s->tored();
-                p->toblack();
-                this->_erase(p);
+                if (node::is_black(p))
+                    this->_erase(p);
+                else
+                    p->toblack();
             }
         }
     }