Skip to content

Commit

Permalink
Per #1448, add GenesisInfoArray::erase_storm_id().
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Dec 30, 2020
1 parent 9009449 commit 638c813
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
26 changes: 15 additions & 11 deletions met/src/libcode/vx_tc_util/genesis_info.cc
Expand Up @@ -588,17 +588,8 @@ bool GenesisInfoArray::add(const GenesisInfo &gi) {
// Skip true duplicates
if(has(gi)) {
mlog << Warning << "\nGenesisInfoArray::add() -> "
<< "Skipping duplicate genesis event:\n" << gi.serialize()
<< "\n\n";
return(false);
}

// Print warning for matches
if(has_storm(gi, i)) {
mlog << Debug(3) << "GenesisInfoArray::add() -> "
<< "Skipping multiple genesis events for the same storm:\n"
<< "Existing: " << Genesis[i].serialize() << "\n"
<< "Skipping: " << gi.serialize() << "\n";
<< "Skipping duplicate genesis event:\n"
<< gi.serialize() << "\n\n";
return(false);
}

Expand Down Expand Up @@ -645,6 +636,19 @@ bool GenesisInfoArray::has_storm_id(const ConcatString &s, int &i) const {

////////////////////////////////////////////////////////////////////////

bool GenesisInfoArray::erase_storm_id(const ConcatString &s) {
int i;
bool status;

if((status = has_storm_id(s, i))) {
Genesis.erase(Genesis.begin()+i);
}

return(status);
}

////////////////////////////////////////////////////////////////////////

int GenesisInfoArray::n_technique() const {
StringArray sa;
int i, n;
Expand Down
1 change: 1 addition & 0 deletions met/src/libcode/vx_tc_util/genesis_info.h
Expand Up @@ -212,6 +212,7 @@ class GenesisInfoArray {
bool has(const GenesisInfo &) const;
bool has_storm(const GenesisInfo &, int &) const;
bool has_storm_id(const ConcatString &, int &) const;
bool erase_storm_id(const ConcatString &);

//
// get stuff
Expand Down

0 comments on commit 638c813

Please sign in to comment.