( self: Cache<Key, A, E, R>, key: Key, fiber: Fiber.Fiber<any, any>, isRead = true )
| 614 | ) |
| 615 | |
| 616 | const getImpl = <Key, A, E, R>( |
| 617 | self: Cache<Key, A, E, R>, |
| 618 | key: Key, |
| 619 | fiber: Fiber.Fiber<any, any>, |
| 620 | isRead = true |
| 621 | ): Entry<A, E> | undefined => { |
| 622 | const oentry = MutableHashMap.get(self.map, key) |
| 623 | if (Option.isNone(oentry)) { |
| 624 | return undefined |
| 625 | } else if (hasExpired(oentry.value, fiber)) { |
| 626 | MutableHashMap.remove(self.map, key) |
| 627 | return undefined |
| 628 | } else if (isRead) { |
| 629 | MutableHashMap.remove(self.map, key) |
| 630 | MutableHashMap.set(self.map, key, oentry.value) |
| 631 | } |
| 632 | return oentry.value |
| 633 | } |
| 634 | |
| 635 | /** |
| 636 | * Retrieves the value associated with the specified key from the cache, only if |
no test coverage detected