From 8b7768f16a4479b4c9c380d665e24fa95ac8198f Mon Sep 17 00:00:00 2001 From: TomTriple Date: Sun, 24 Sep 2023 15:41:13 +0200 Subject: [PATCH] memoized is not used (#2429) memoized not used --- .../zio/http/endpoint/internal/Memoized.scala | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 zio-http/src/main/scala/zio/http/endpoint/internal/Memoized.scala diff --git a/zio-http/src/main/scala/zio/http/endpoint/internal/Memoized.scala b/zio-http/src/main/scala/zio/http/endpoint/internal/Memoized.scala deleted file mode 100644 index 0ae6bc72d2..0000000000 --- a/zio-http/src/main/scala/zio/http/endpoint/internal/Memoized.scala +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2021 - 2023 Sporta Technologies PVT LTD & the ZIO HTTP contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package zio.http.endpoint.internal - -import zio.stacktracer.TracingImplicits.disableAutoTrace - -private[http] class Memoized[K, A] private (compute: K => A) { self => - private var map: Map[K, A] = Map() - - def get(api: K): A = { - map.get(api) match { - case Some(a) => a - case None => - val a = compute(api) - map = map.updated(api, a) - a - } - } -} -private[http] object Memoized { - def apply[K, A](compute: K => A): Memoized[K, A] = new Memoized(compute) -}