Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: tools/binary_size/libsupersize/console.py

Issue 2869873002: supersize: Sort diffs by default (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/binary_size/libsupersize/diff.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/console.py
diff --git a/tools/binary_size/libsupersize/console.py b/tools/binary_size/libsupersize/console.py
index a25839aec8fdb1a2df8b186bd605b3206b99dc79..1321efbea6c05a736c5d4cadceda525e7a53b449 100644
--- a/tools/binary_size/libsupersize/console.py
+++ b/tools/binary_size/libsupersize/console.py
@@ -84,18 +84,24 @@ class _Session(object):
for i, size_info in enumerate(size_infos):
self._variables['size_info%d' % (i + 1)] = size_info
- def _DiffFunc(self, before=None, after=None, cluster=True):
+ def _DiffFunc(self, before=None, after=None, cluster=True, sort=True):
"""Diffs two SizeInfo objects. Returns a SizeInfoDiff.
Args:
before: Defaults to first size_infos[0].
after: Defaults to second size_infos[1].
- cluster: When True, calls SymbolGroup.Cluster() after diffing. This
- generally reduces noise.
+ cluster: When True (default), calls SymbolGroup.Cluster() after diffing.
+ Generally reduces noise.
+ sort: When True (default), calls SymbolGroup.Sorted() after diffing.
"""
before = before if before is not None else self._size_infos[0]
after = after if after is not None else self._size_infos[1]
- return diff.Diff(before, after, cluster=cluster)
+ ret = diff.Diff(before, after)
+ if cluster:
+ ret.symbols = ret.symbols.Cluster()
+ if sort:
+ ret.symbols = ret.symbols.Sorted()
+ return ret
def _PrintFunc(self, obj=None, verbose=False, recursive=False, use_pager=None,
to_file=None):
« no previous file with comments | « no previous file | tools/binary_size/libsupersize/diff.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698