opt: reduce copy and malloc times for both of flutter and rust

This commit is contained in:
Kingtous
2023-02-12 01:52:11 +08:00
parent f521b1665a
commit 01d30bce9e
7 changed files with 105 additions and 38 deletions

View File

@@ -104,16 +104,6 @@ pub fn session_get_remember(id: String) -> Option<bool> {
}
}
pub fn session_get_rgba(id: String) -> Option<ZeroCopyBuffer<Vec<u8>>> {
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
return match session.get_rgba() {
Some(buf) => Some(ZeroCopyBuffer(buf)),
_ => None
};
}
None
}
pub fn session_get_toggle_option(id: String, arg: String) -> Option<bool> {
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
Some(session.get_toggle_option(arg))