Fix Version/s: None
The fix to
DM-2883 (remove illegal PVi_j cards) isn't quite right, and the error was masked by a piece of code elsewhere that duplicated the functionality.
The issues is that while PV1_[1-4] cards are indeed valid, the ones that SCAMP writes are not. So we should remove them too, if there are any other SCAMP TPV coefficients.
The masking code was a unilateral removal of PVi_j cards dating back years.
The code as written won't compile on GCC 4.4, which doesn't support range-based for. That's an easy fix, though. I made a couple of other minor comments in the GitHub PR.
The previous code renamed, rather than simply removed, the troublesome header cards. I'm not sure if that was useful. Do you think it's behaviour that's worth preserving?
How about a test case?