From 08e977efe503097f99fa69c4ae4b80cb6ee6ec86 Mon Sep 17 00:00:00 2001 From: Tim Flynn Date: Mon, 14 Nov 2016 13:17:42 -0500 Subject: [PATCH] Change signature of Insert method to return indication of whether insertion succeeded --- src/cachemultimap.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cachemultimap.h b/src/cachemultimap.h index 4cdf12285..9a2bb5b2c 100644 --- a/src/cachemultimap.h +++ b/src/cachemultimap.h @@ -89,7 +89,7 @@ public: return nCurrentSize; } - void Insert(const K& key, const V& value) + bool Insert(const K& key, const V& value) { if(nCurrentSize == nMaxSize) { PruneLast(); @@ -102,7 +102,7 @@ public: if(mapIt.count(value) > 0) { // Don't insert duplicates - return; + return false; } listItems.push_front(item_t(key, value)); @@ -110,6 +110,7 @@ public: mapIt[value] = lit; ++nCurrentSize; + return true; } bool HasKey(const K& key) const