Only call check_for_pruning whenever we have a message that can be
pruned
Merge pull request #242 from NielsZeilemaker/optimize_pruning

Only call check_for_pruning whenever we have a message that can be