Extract the range-matching-predicate logic from eraseAppended
Merge pull request #27 from smspillaz/yiqi.item_23

Extract the range-matching-predicate logic from eraseAppended