/* * SPDX-FileCopyrightText: 2024 Linnea Gräf * * SPDX-License-Identifier: GPL-3.0-or-later */ package moe.nea.firmament.util fun mutableMapWithMaxSize(maxSize: Int): MutableMap = object : LinkedHashMap() { override fun removeEldestEntry(eldest: MutableMap.MutableEntry): Boolean { return size > maxSize } }