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

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

Issue 2924343004: supersize: Fix path counts, missing section in clusters (Closed)
Patch Set: add comments Created 3 years, 6 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/describe.py
diff --git a/tools/binary_size/libsupersize/describe.py b/tools/binary_size/libsupersize/describe.py
index ad0412950869697b6604298742eb4af55e0a243d..4d76727675a6c425cb85c9614c31ebaeabc86b30 100644
--- a/tools/binary_size/libsupersize/describe.py
+++ b/tools/binary_size/libsupersize/describe.py
@@ -200,15 +200,23 @@ class Describer(object):
if s.IsGroup():
helper(s)
else:
- status = group.DiffStatus(s)
- paths_by_status[status].add(s.source_path or s.object_path)
+ path = s.source_path or s.object_path
+ # Ignore paths like foo/{shared}/2
+ if '{' not in path:
+ paths_by_status[group.DiffStatus(s)].add(path)
helper(diff)
- # Show only paths that have no changed symbols (pure adds / removes).
+ # Initial paths sets are those where *any* symbol is
+ # unchanged/changed/added/removed.
unchanged, changed, added, removed = paths_by_status
+ # Consider a path with both adds & removes as "changed".
+ changed.update(added.intersection(removed))
+ # Consider a path added / removed only when all symbols are new/removed.
added.difference_update(unchanged)
added.difference_update(changed)
+ added.difference_update(removed)
removed.difference_update(unchanged)
removed.difference_update(changed)
+ removed.difference_update(added)
yield '{} paths added, {} removed, {} changed'.format(
len(added), len(removed), len(changed))
« 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