The cultivation of compassion itself … finds its expression in the wish for the other to be free from dukkha. In this way, the mind takes the vision of freedom from affliction as its object. Such an object can generate a positive, at times even a joyful state of mind, instead of resulting in sadness. This is vital in so far as the meditative cultivation of compassion can only lead to deeper concentration if it is undertaken with a positive or even joyful mind.
…it is important to monitor closely one’s own response to the affliction of others. This should ideally proceed from the opening of the heart that is genuinely receptive to the pain and suffering of others, to the positive mental condition of being filled with the wish for others to be free from affliction and suffering.
Anālayo, B. (2015). Compassion and emptiness in early Buddhist meditation, pp.6-7. Cambridge: Windhorse.