From cfc180e2115ee6f2ff5b67b0b02b1286ccd312a9 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 21 Nov 2020 19:49:10 +0100 Subject: [PATCH] human.format_address: add lru cache --- mitmproxy/utils/human.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mitmproxy/utils/human.py b/mitmproxy/utils/human.py index 73d92e722..951feef4a 100644 --- a/mitmproxy/utils/human.py +++ b/mitmproxy/utils/human.py @@ -75,6 +75,7 @@ def format_timestamp_with_milli(s): return d.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] +@functools.lru_cache() def format_address(address: typing.Optional[tuple]) -> str: """ This function accepts IPv4/IPv6 tuples and