Use DBUG_ASSERT(ptr != NULL) to ease merging to 10.3

In 10.3, DBUG_ASSERT() may expand to something that includes
__builtin_expect(), which expects integer arguments, not pointers.
To avoid any compiler warnings, let us use an explicit rather than
implicit comparison to the null pointer.
This commit is contained in:
Marko Mäkelä 2020-08-12 13:08:17 +03:00
parent 5a4ae142f4
commit 4387e3a13b

View File

@ -71,12 +71,12 @@ public:
typedef T *pointer; typedef T *pointer;
typedef T &reference; typedef T &reference;
Iterator(ListNode *node) : node_(node) { DBUG_ASSERT(node_); } Iterator(ListNode *node) : node_(node) { DBUG_ASSERT(node_ != NULL); }
Iterator &operator++() Iterator &operator++()
{ {
node_= node_->next; node_= node_->next;
DBUG_ASSERT(node_); DBUG_ASSERT(node_ != NULL);
return *this; return *this;
} }
Iterator operator++(int) Iterator operator++(int)