You did not specify which model of C 172 you are flying. The POH for C 172 M model specify flap 10 only for short fields with no obstacles in order to shorten the ground roll.
But it specifies that they should be up for short fields with obstacles as the aircraft will get to 50 feet in a shorter distance then if the flaps where at 10.
However the POH for C 172 P, R, and S models specify using flap 10 for
all short field takeoffs and notes it will reduce both ground roll and the distance needed to get o 50 feet to clear an obstacle by approximately 10 %
When in doubt read the POH