diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-25 11:09:56 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-25 11:21:43 +0200 |
commit | 82e370b4b0d3ddd31f7c108f4f718b291bce870a (patch) | |
tree | 6c97d0d2d567e3bfa0210492bb4ee97bf0851f24 | |
parent | 346d5443f1b12a14fca90cc3ccbfa6ce94798aae (diff) | |
parent | 2e5361b9c20517a22a4d1fdae3077d23800ecba7 (diff) | |
download | bitcoin-82e370b4b0d3ddd31f7c108f4f718b291bce870a.tar.xz |
Merge pull request #4782
2e5361b remove code below asserts in limitedmap.h (fixes a ToDo) (Philip Kaufmann)
-rw-r--r-- | src/limitedmap.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/limitedmap.h b/src/limitedmap.h index 4bc8d9e5aa..03727d7c42 100644 --- a/src/limitedmap.h +++ b/src/limitedmap.h @@ -1,11 +1,11 @@ -// Copyright (c) 2012 The Bitcoin developers -// Distributed under the MIT/X11 software license, see the accompanying +// Copyright (c) 2012-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_LIMITEDMAP_H #define BITCOIN_LIMITEDMAP_H -#include <assert.h> // TODO: remove +#include <assert.h> #include <map> /** STL-like map container that only keeps the N elements with the highest value. */ @@ -59,12 +59,11 @@ public: return; } // Shouldn't ever get here - assert(0); //TODO remove me - map.erase(itTarget); + assert(0); } void update(const_iterator itIn, const mapped_type& v) { - //TODO: When we switch to C++11, use map.erase(itIn, itIn) to get the non-const iterator + // TODO: When we switch to C++11, use map.erase(itIn, itIn) to get the non-const iterator. iterator itTarget = map.find(itIn->first); if (itTarget == map.end()) return; @@ -77,9 +76,7 @@ public: return; } // Shouldn't ever get here - assert(0); //TODO remove me - itTarget->second = v; - rmap.insert(make_pair(v, itTarget)); + assert(0); } size_type max_size() const { return nMaxSize; } size_type max_size(size_type s) |