astutils.cpp: optimized followAllReferences() a bit
#5442
Merged
followAllReferences() a bit
#5442