From 89b5a8731e13cb4ce9fc81a2d6bb7ce358711d5f Mon Sep 17 00:00:00 2001 From: eidheim Date: Sat, 14 May 2016 21:50:31 +0200 Subject: [PATCH] Improved clang::Cursor::has_type --- src/Cursor.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Cursor.cc b/src/Cursor.cc index 8ed74de..07db31c 100644 --- a/src/Cursor.cc +++ b/src/Cursor.cc @@ -34,14 +34,12 @@ bool clang::Cursor::operator==(const Cursor& rhs) const { return get_usr()==rhs.get_usr(); } -//TODO: Is there a way to optimise this? bool clang::Cursor::has_type() { auto referenced=clang_getCursorReferenced(cx_cursor); if(clang_Cursor_isNull(referenced)) return false; auto type=clang_getCursorType(referenced); - auto spelling=clang::to_string(clang_getTypeSpelling(type)); - return spelling!=""; + return type.kind!=0; } std::string clang::Cursor::get_type() {