mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-02-02 04:12:25 +00:00
Directly dereference DebugCategory struct to read the threshold and #[inline]
This should improve logging performance if the threshold is not high enough.
This commit is contained in:
parent
c38af51bf0
commit
fc7cda4522
1 changed files with 5 additions and 2 deletions
|
@ -102,6 +102,7 @@ impl DebugCategory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn log<O: IsA<::Object>>(
|
pub fn log<O: IsA<::Object>>(
|
||||||
&self,
|
&self,
|
||||||
obj: Option<&O>,
|
obj: Option<&O>,
|
||||||
|
@ -111,8 +112,10 @@ impl DebugCategory {
|
||||||
line: u32,
|
line: u32,
|
||||||
args: fmt::Arguments,
|
args: fmt::Arguments,
|
||||||
) {
|
) {
|
||||||
if level.to_glib() as u32 > self.get_threshold().to_glib() as u32 {
|
unsafe {
|
||||||
return;
|
if level.to_glib() as i32 > (*self.0).threshold {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let obj_ptr = match obj {
|
let obj_ptr = match obj {
|
||||||
|
|
Loading…
Reference in a new issue