summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-02-27 19:49:02 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-02-27 19:50:19 +0100
commitcd55e94b20d9e2b2f04712cb655c9075aab4e143 (patch)
tree474231cd265e7bfc4c3c4760db79c236921ccf12
parent4e4f092d603828647bae12754a57c59efdfee005 (diff)
clang: Avoid a hot FFI call for getting the cursor kind.
This is a sorta-hot call already. I've noticed #544 wants to add more assertions about this, and was going to suggest moving them to `debug_assert!`. But there's an easier way :) Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
-rw-r--r--src/clang.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/clang.rs b/src/clang.rs
index 1a45eefa..35dd7cc3 100644
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -208,7 +208,7 @@ impl Cursor {
/// Get the kind of referent this cursor is pointing to.
pub fn kind(&self) -> CXCursorKind {
- unsafe { clang_getCursorKind(self.x) }
+ self.x.kind
}
/// Returns true is the cursor is a definition