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

This commit is contained in:
Kingtous committed 2023-02-12 08:08:44 +08:00
1 parent f521b1665a
commit 01d30bce9e
7 files changed
+105 -38

No files matched your search

-10
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))