[PATCH] [LNT] Fix plotting issue caused by r188111
Yi Kong
Yi.Kong at arm.com
Wed Apr 23 02:16:38 PDT 2014
The bug is introduced in revision 188111, when date is added to graph point metadata. min(enumerate(values)) is used to retrieve both minimum value and its index. However Python prioritize the first element in tuple when sorting, thus the actual value retrieved is the first run value. The fix flips the elements of tuple so that the value is prioritized over run order.
No new regression is introduced because the changed value is local.
http://reviews.llvm.org/D3465
Files:
lnt/server/ui/views.py
Index: lnt/server/ui/views.py
===================================================================
--- lnt/server/ui/views.py
+++ lnt/server/ui/views.py
@@ -629,7 +629,7 @@
x = rev_x[0] if len(rev_x)==1 else pos
values = [v*normalize_by for v in data]
- min_index,min_value = min(enumerate(values))
+ min_value,min_index = min((value, index) for (index, value) in enumerate(values))
metadata["date"] = str(dates[min_index])
pts.append((x, min_value, metadata))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3465.8766.patch
Type: text/x-patch
Size: 538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140423/471abc33/attachment.bin>
More information about the llvm-commits
mailing list