Fix one more bug - upper_bound() works a little differently to what we want!
authorMario de Sousa <msousa@fe.up.pt>
Fri, 09 Nov 2012 13:08:18 +0000
changeset 723 d475ae61c7f8
parent 722 b051d19d2442
child 724 d19877568878
Fix one more bug - upper_bound() works a little differently to what we want!
util/dsymtable.hh
--- a/util/dsymtable.hh	Thu Nov 08 17:54:48 2012 +0000
+++ b/util/dsymtable.hh	Fri Nov 09 13:08:18 2012 +0000
@@ -106,7 +106,7 @@
     iterator lower_bound(const symbol_c *symbol)     {return lower_bound(symbol_to_string(symbol));}
     
     /* Search for the first entry with key greater than identifier_str. Will return end() if not found */
-    iterator upper_bound(const char *identifier_str) {return _base.upper_bound(identifier_str);}
+    iterator upper_bound(const char *identifier_str) {return ((count(identifier_str) == 0)? _base.end() : _base.upper_bound(identifier_str));}
     iterator upper_bound(const symbol_c *symbol)     {return upper_bound(symbol_to_string(symbol));}
 
     /* get the value to which an iterator is pointing to... */