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

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

Issue 2928783002: Handling disappear or new sections in after.size file (Closed)
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/diff.py
diff --git a/tools/binary_size/libsupersize/diff.py b/tools/binary_size/libsupersize/diff.py
index 910d72c73342e3310e209c1f930633b70c2ce76f..7002afb750652bf4a09f09cd65601a625fb4f9e7 100644
--- a/tools/binary_size/libsupersize/diff.py
+++ b/tools/binary_size/libsupersize/diff.py
@@ -182,8 +182,12 @@ def Diff(before, after):
"""Diffs two SizeInfo objects. Returns a SizeInfoDiff."""
assert isinstance(before, models.SizeInfo)
assert isinstance(after, models.SizeInfo)
- section_sizes = {k: after.section_sizes[k] - v
+ section_sizes = {k: after.section_sizes.get(k, 0) - v
for k, v in before.section_sizes.iteritems()}
+ for k, v in after.section_sizes.iteritems():
+ if k not in section_sizes:
+ section_sizes[k] = v
+
symbol_diff = _DiffSymbolGroups(before.raw_symbols, after.raw_symbols)
return models.SizeInfoDiff(section_sizes, symbol_diff, before.metadata,
after.metadata)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698