Skip to content

Commit 486661c

Browse files
remove some cfg switches and cleanup
1 parent 5b80cf7 commit 486661c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

profiling/src/exception.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ impl ExceptionProfilingStats {
5656
}
5757

5858
#[cfg(php7)]
59-
let exception_name = unsafe { (*(*exception).value.obj).class_name() };
60-
#[cfg(php8)]
59+
let exception = unsafe { (*exception).value.obj };
60+
6161
let exception_name = unsafe { (*exception).class_name() };
6262

6363
let collect_message = REQUEST_LOCALS.with(|cell| {
@@ -67,12 +67,8 @@ impl ExceptionProfilingStats {
6767
});
6868

6969
let message = if collect_message {
70-
#[cfg(php7)]
71-
let exception_obj = unsafe { (*exception).value.obj };
72-
#[cfg(php8)]
73-
let exception_obj = exception;
7470
Some(unsafe {
75-
zend::zai_str_from_zstr(zend::zai_exception_message(exception_obj).as_mut())
71+
zend::zai_str_from_zstr(zend::zai_exception_message(exception).as_mut())
7672
.into_string()
7773
})
7874
} else {

0 commit comments

Comments
 (0)