>  As I mentioned in #1438, this commit duplicates most of the code in DeleteAllKeysInList

@andrewgaul Ah, didn't see that. Yes, we should certainly not duplicate that if we can avoid it...