[PATCH] [LNT] Fix plotting issue caused by r188111

Chris Matthews chris.matthews at apple.com
Wed Apr 30 08:28:57 PDT 2014


Looks good to me! 

On Apr 23, 2014, at 2:16 AM, Yi Kong <Yi.Kong at arm.com> wrote:

> 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))
> <D3465.8766.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list