From c6101e1af9b9f116d30b285c06abd1ee69777f03 Mon Sep 17 00:00:00 2001
From: Will Hawkins <whh8b@virginia.edu>
Date: Tue, 3 Jul 2018 05:02:17 +0000
Subject: [PATCH] Remove empty scoop from global set selectively

Thanks to a change to the time when scoops are
added to the file's data scoops, the clause that
removes empty data scoops should not *always*
remove empty scoops from the set of global scoops.
---
 src/zipr.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/zipr.cpp b/src/zipr.cpp
index b8de2cd..4110a85 100644
--- a/src/zipr.cpp
+++ b/src/zipr.cpp
@@ -4284,10 +4284,13 @@ void ZiprImpl_t::UpdateScoops()
 			m_firp->GetAddresses().erase(scoop->GetStart());
 			m_firp->GetAddresses().erase(scoop->GetEnd());
 
-			// erase and move to next element.
-			it=m_firp->GetDataScoops().erase(it);
+			if (m_verbose)
+				cout << "Removing an empty scoop (" << scoop->GetName() << ")." << endl;
+
+			m_firp->GetDataScoops().erase(*it);
+			it = m_zipr_scoops.erase(it);
 
-			// remove addresses and scoop
+			// Delete addresses and then the scoop itself.
 			delete scoop->GetStart();
 			delete scoop->GetEnd();
 			delete scoop;
-- 
GitLab