Import revision 48773 from the v5-34-00 patch branch:
In GetDirectory instead of loading the object and then check the type is correct, use GetObject to check before hand.


git-svn-id: https://root.cern.ch/svn/root/trunk@48774 27541ba8-7e3a-0410-8455-c3a389f83636