diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2012-04-04 15:47:39 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-04-05 07:46:07 -0500 |
commit | 3f745dd4998f42e82fecadd4bcdd7e5662ad6b01 (patch) | |
tree | e6804e5e1d671938cffcc273c8d3a032d42b37c7 /src/include/util | |
parent | 493229c3892ab031cb46621f4de99715731d63db (diff) | |
download | talos-hostboot-3f745dd4998f42e82fecadd4bcdd7e5662ad6b01.tar.gz talos-hostboot-3f745dd4998f42e82fecadd4bcdd7e5662ad6b01.zip |
Fix broken map::operator[].
According to the STL documentation, 'insert' should do nothing if
attempting to insert an item that already exists. This allows []
to be implemented as a form of insert(pair(key, data_T())). Our
insert was actually updating the data portion of the map, which
was causing operator[] to always erase the data portion of any
lookup.
Change-Id: I5b2ae1934dbd81d71df4b56d83e2f04f53f0e525
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/825
Tested-by: Jenkins Server
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: Bradley W. Bishop <bradleyb@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/util')
-rw-r--r-- | src/include/util/impl/stlmap.H | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/include/util/impl/stlmap.H b/src/include/util/impl/stlmap.H index bed6674b7..599e1ed22 100644 --- a/src/include/util/impl/stlmap.H +++ b/src/include/util/impl/stlmap.H @@ -340,7 +340,6 @@ namespace Util } else { - reinterpret_cast<_Node*>(n)->data_T().second = x.second; return make_pair(iterator(_TreeItr(&iv_tree, n)), true); } |