mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-17 09:25:50 +00:00
swap
This commit is contained in:
parent
e6e96a71e6
commit
0f775341a6
@ -120,8 +120,8 @@ pub async fn get_actor_cached(
|
||||
/// intern urls to reduce memory usage
|
||||
/// not sure if worth it
|
||||
pub fn intern_url<'a>(url: impl Into<Cow<'a, Url>>) -> Arc<Url> {
|
||||
let url: Cow<'a, Url> = url.into();
|
||||
static INTERNED_URLS: Lazy<DashSet<Arc<Url>>> = Lazy::new(DashSet::new);
|
||||
let url: Cow<'a, Url> = url.into();
|
||||
return INTERNED_URLS
|
||||
.get::<Url>(url.borrow())
|
||||
.map(|e| e.clone())
|
||||
|
Loading…
Reference in New Issue
Block a user