Commit fc7cda45 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Directly dereference DebugCategory struct to read the threshold and #[inline]

This should improve logging performance if the threshold is not high
enough.
parent c38af51b
......@@ -102,6 +102,7 @@ impl DebugCategory {
}
}
#[inline]
pub fn log<O: IsA<::Object>>(
&self,
obj: Option<&O>,
......@@ -111,8 +112,10 @@ impl DebugCategory {
line: u32,
args: fmt::Arguments,
) {
if level.to_glib() as u32 > self.get_threshold().to_glib() as u32 {
return;
unsafe {
if level.to_glib() as i32 > (*self.0).threshold {
return;
}
}
let obj_ptr = match obj {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment