mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-22 06:58:13 +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>>(
|
||||
&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 {
|
||||
|
|
Loading…
Reference in a new issue