From 845cf54d6bd184002887a099c453290fcbfc8ab2 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Mon, 5 Aug 2024 10:13:08 +0800 Subject: [PATCH] SingletonHolder: Drop unused class All classes which were using this have been migrated to hilt or object Signed-off-by: Aayush Gupta --- .../com/aurora/store/data/SingletonHolder.kt | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 app/src/main/java/com/aurora/store/data/SingletonHolder.kt diff --git a/app/src/main/java/com/aurora/store/data/SingletonHolder.kt b/app/src/main/java/com/aurora/store/data/SingletonHolder.kt deleted file mode 100644 index 7f2236fd6..000000000 --- a/app/src/main/java/com/aurora/store/data/SingletonHolder.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Aurora Store - * Copyright (C) 2021, Rahul Kumar Patel - * - * Aurora Store is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * Aurora Store is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Aurora Store. If not, see . - * - */ - -package com.aurora.store.data - -open class SingletonHolder(private val constructor: (A) -> T) { - - @Volatile - private var instance: T? = null - - fun with(arg: A): T { - return when { - instance != null -> instance!! - else -> synchronized(this) { - if (instance == null) instance = constructor(arg) - instance!! - } - } - } -} \ No newline at end of file