From ded614b98682f9b6061f0c402967a1404133f030 Mon Sep 17 00:00:00 2001 From: Pawel Date: Mon, 15 Apr 2024 23:25:39 -0700 Subject: [PATCH] simplify algo --- rollbar/lib/transforms/shortener.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rollbar/lib/transforms/shortener.py b/rollbar/lib/transforms/shortener.py index ae8d810b..89ae5a58 100644 --- a/rollbar/lib/transforms/shortener.py +++ b/rollbar/lib/transforms/shortener.py @@ -78,8 +78,6 @@ def _shorten_other(self, obj): return self._repr.repr(obj) def traverse_dict(self, d): - max_size = self._get_max_size(d) - d = self._shorten_mapping(d, max_size) for k, v in d.items(): if isinstance(v, dict): max_size = self._get_max_size(v) @@ -93,6 +91,8 @@ def _shorten(self, val): max_size = self._get_max_size(val) if isinstance(val, dict): + max_size = self._get_max_size(val) + val = self._shorten_mapping(val, max_size) return self.traverse_dict(val) if isinstance(val, (string_types, sequence_types)):