CID 1240027: Use ranged erase instead