Simplified implementation of ifpurge()