Remove parameter count caching -- should be cheap (if statically linked at least...)

This commit is contained in:
Thom Chiovoloni
2020-04-16 11:08:36 -07:00
committed by Thom Chiovoloni
parent a776f460e8
commit d88fe1c1b1
2 changed files with 1 additions and 22 deletions

View File

@@ -9,18 +9,3 @@ pub(crate) use small_cstr::SmallCString;
mod sqlite_string;
#[cfg(any(feature = "modern_sqlite", feature = "vtab"))]
pub(crate) use sqlite_string::SqliteMallocString;
#[inline]
pub(crate) fn get_cached<T, F>(cache: &std::cell::Cell<Option<T>>, lookup: F) -> T
where
T: Copy,
F: FnOnce() -> T,
{
if let Some(v) = cache.get() {
v
} else {
let cb = lookup();
cache.set(Some(cb));
cb
}
}