I'm trying to find all terms in a vocabulary associated with the current node, that do not have any children.
The most obvious way might be to use taxonomy_get_tree() and match with the returned array to find the childless. Another way is to use a function like this one, and it involves a MySQL query. While my current taxonomy is small and the performance concerns are minimal, I would like to avoid this if this info is already available somewhere.
So, how can I find the depth of a taxonomy term, in a more performance friendly way?