Remove custom erase_if function in favor of std::remove_if

It was originally added before I understood the correct way to use remove_if

As a side-effect, remove bad status now also removes forcecage and charm.
This commit is contained in:
2017-04-14 01:16:57 -04:00
parent 936a848166
commit 5b5b2af46f
4 changed files with 25 additions and 37 deletions

View File

@@ -25,16 +25,6 @@ inline void move_to_zero(T& val){
val--;
}
// Not quite mathutil... perhaps I need a more general util file.
// This is from <http://stackoverflow.com/a/16597048>.
template<typename ContainerT, typename PredicateT >
void erase_if(ContainerT& items, const PredicateT& predicate) {
for(auto it = items.begin(); it != items.end();) {
if(predicate(*it)) it = items.erase(it);
else ++it;
}
};
// Case-insensitive string comparison seems to be semi-standard, but with different names.
#if defined(__APPLE__)
#define strnicmp strncasecmp