Use cached values

Summary: Instead of calling out the Rust functions all the time, just use the public global variables initialised lazily.

Differential Revision: D38241744

fbshipit-source-id: dd66e8d563076fed9279358a2b22c2042d365cc9
This commit is contained in:
Ioan Budea 2022-08-10 11:06:01 -07:00 committed by Facebook GitHub Bot
parent 7d14b4cf42
commit c448e50fee

View File

@ -52,20 +52,20 @@ pub extern "C" fn fb_get_env() -> u8 {
#[no_mangle]
pub extern "C" fn fb_is_prod() -> bool {
is_prod()
*IN_PROD
}
#[no_mangle]
pub extern "C" fn fb_is_corp() -> bool {
is_corp()
*IN_CORP
}
#[no_mangle]
pub extern "C" fn fb_is_lab() -> bool {
is_lab()
*IN_LAB
}
#[no_mangle]
pub extern "C" fn fb_has_servicerouter() -> bool {
is_prod()
*IN_PROD
}