From 67494bd6e7dea5684000f80cf058e4ae111a8657 Mon Sep 17 00:00:00 2001 From: Hamm Date: Fri, 14 Jul 2023 07:24:32 +0000 Subject: [PATCH] =?UTF-8?q?add(swift/=F0=9F=90=94=F0=9F=92=A9.swift):=20?= =?UTF-8?q?=E6=9D=A5=E8=87=AA=20@zhiyin=20=E5=BC=80=E6=BA=90=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E4=B8=80=E6=AE=B5=E7=A5=9E=E7=BA=A7=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hamm --- .../\360\237\220\224\360\237\222\251.swift" | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "swift/\360\237\220\224\360\237\222\251.swift" diff --git "a/swift/\360\237\220\224\360\237\222\251.swift" "b/swift/\360\237\220\224\360\237\222\251.swift" new file mode 100644 index 0000000..b8cd880 --- /dev/null +++ "b/swift/\360\237\220\224\360\237\222\251.swift" @@ -0,0 +1,33 @@ +// +// 🐔💩.swift +// + +import Foundation + +class 🐔💩<🐔: Hashable, 💩> { + private var 💩🪣 = [🐔: 💩]() + + func 👈(_ 🐔: 🐔, 💩📦: @escaping ()-> 💩) -> 💩 { + if 💩🪣[🐔] == nil { + 💩🪣[🐔] = 💩📦() + } + return 💩🪣[🐔]! + } + + func 👈(_ 🐔: 🐔) -> 💩? { + return 💩🪣[🐔] + } + + func 👉(_ 🐔: 🐔, _ 💩: 💩) -> 💩 { + 💩🪣[🐔] = 💩 + return 💩 + } + + func 🔄(_ 🐔: 🐔) { + 💩🪣.removeValue(forKey: 🐔) + } + + func 🔄() { + 💩🪣.removeAll() + } +} \ No newline at end of file -- Gitee