Remove tow unused files (#22022)

This commit is contained in:
Yongtao Huang 2025-07-09 09:28:26 +08:00 committed by GitHub
commit 521488f926
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 90 deletions

View file

@ -1,22 +0,0 @@
from collections import OrderedDict
from typing import Any
class LRUCache:
def __init__(self, capacity: int):
self.cache: OrderedDict[Any, Any] = OrderedDict()
self.capacity = capacity
def get(self, key: Any) -> Any:
if key not in self.cache:
return None
else:
self.cache.move_to_end(key) # move the key to the end of the OrderedDict
return self.cache[key]
def put(self, key: Any, value: Any) -> None:
if key in self.cache:
self.cache.move_to_end(key)
self.cache[key] = value
if len(self.cache) > self.capacity:
self.cache.popitem(last=False) # pop the first item