From 5770c916c0cf110ced690ff128b065bbb2c827ca Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Sat, 29 Jun 2019 08:33:05 -0400 Subject: papi: refactor set_errors_str Assuming 2500 50 char lines: string_concat elapsed: 5.919933e-04 string_join elapsed: 2.830029e-04 string_concat size: 156,312,500 string_join size: 125,000 Type: refactor Change-Id: I0a400265426bde492e9a651d24996ddcfe954aa1 Signed-off-by: Paul Vinciguerra --- src/vpp-api/python/vpp_papi/vpp_stats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py index 3638892135f..eeaa32d7229 100644 --- a/src/vpp-api/python/vpp_papi/vpp_stats.py +++ b/src/vpp-api/python/vpp_papi/vpp_stats.py @@ -292,8 +292,8 @@ class VPPStats(object): def set_errors_str(self): '''Return all errors counters > 0 pretty printed''' - s = 'ERRORS:\n' + s = ['ERRORS:'] error_counters = self.set_errors() for k in sorted(error_counters): - s += '{:<60}{:>10}\n'.format(k, error_counters[k]) - return s + s.append('{:<60}{:>10}'.format(k, error_counters[k])) + return '%s\n' % '\n'.join(s) -- cgit 1.2.3-korg