Use yang::LeafRef::m_targetType in describe
The target type info is available immediately, it is not necessary to
query the schema again.
Change-Id: Ib68dc5897d8f8d3a6739eac1866f97d05b246aea
diff --git a/src/interpreter.cpp b/src/interpreter.cpp
index 1cfef74..c7f6644 100644
--- a/src/interpreter.cpp
+++ b/src/interpreter.cpp
@@ -103,7 +103,7 @@
if (std::holds_alternative<yang::LeafRef>(leafType)) {
ss << "-> ";
ss << m_datastore.schema()->leafrefPath(path) << " ";
- baseTypeStr = leafDataTypeToString(m_datastore.schema()->leafType(std::get<yang::LeafRef>(leafType).m_targetXPath));
+ baseTypeStr = leafDataTypeToString(*std::get<yang::LeafRef>(leafType).m_targetType);
} else {
baseTypeStr = leafDataTypeToString(leafType);
}