Patchwork [v3] libstdc++/51209

login
register
mail settings
Submitter Paolo Carlini
Date Nov. 18, 2011, 4:10 p.m.
Message ID <4EC68386.2000704@oracle.com>
Download mbox | patch
Permalink /patch/126439/
State New
Headers show

Comments

Paolo Carlini - Nov. 18, 2011, 4:10 p.m.
Hi,

tested x86_64-linux, committed to mainline.

Paolo.

/////////////////
2011-11-18  Harti Brandt  <hartmut.brandt@dlr.de>

	PR libstdc++/51209
	* include/bits/hashtable.h (_Hashtable<>::_M_find_node): Return
	nullptr when no node is found.
	* include/tr1/hashtable.h (_Hashtable<>::_M_find_node): Return
	zero when no node is found.

Patch

Index: include/bits/hashtable.h
===================================================================
--- include/bits/hashtable.h	(revision 181477)
+++ include/bits/hashtable.h	(working copy)
@@ -873,7 +873,7 @@ 
     }
 
   // Find the node whose key compares equal to k, beginning the search
-  // at p (usually the head of a bucket).  Return nil if no node is found.
+  // at p (usually the head of a bucket).  Return nullptr if no node is found.
   template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
@@ -889,7 +889,7 @@ 
       for (; __p; __p = __p->_M_next)
 	if (this->_M_compare(__k, __code, __p))
 	  return __p;
-      return false;
+      return nullptr;
     }
 
   // Insert v in bucket n (assumes no element with its key already present).
Index: include/tr1/hashtable.h
===================================================================
--- include/tr1/hashtable.h	(revision 181477)
+++ include/tr1/hashtable.h	(working copy)
@@ -813,7 +813,7 @@ 
     }
 
   // Find the node whose key compares equal to k, beginning the search
-  // at p (usually the head of a bucket).  Return nil if no node is found.
+  // at p (usually the head of a bucket).  Return zero if no node is found.
   template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
@@ -829,7 +829,7 @@ 
       for (; __p; __p = __p->_M_next)
 	if (this->_M_compare(__k, __code, __p))
 	  return __p;
-      return false;
+      return 0;
     }
 
   // Insert v in bucket n (assumes no element with its key already present).