diff options
author | jasplin <qt-info@nokia.com> | 2011-02-09 11:47:20 +0100 |
---|---|---|
committer | jasplin <qt-info@nokia.com> | 2011-02-09 11:47:20 +0100 |
commit | 7832429116c6e657b114deac5f678e09feef5767 (patch) | |
tree | 85fa84bdcf04bd736ff2247099b8051111bbd70c | |
parent | d70215a964367fa8547774d14be5e41ff1cfd541 (diff) |
Fixed bug: maxsize must be applied _after_ sorting.
-rw-r--r-- | scripts/getrankings.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/getrankings.py b/scripts/getrankings.py index 7c20b6b..5b11453 100644 --- a/scripts/getrankings.py +++ b/scripts/getrankings.py @@ -57,10 +57,8 @@ class GetRankings: "SELECT benchmarkId, metricId, context1Id, pos, value" " FROM ranking" " WHERE context2Id = %d" - " AND statId = %d %s;" - % (self.context2_id, stat_id, - ("LIMIT %d" % self.maxsize) - if (self.maxsize > 0) else "")) + " AND statId = %d;" + % (self.context2_id, stat_id)) for row in stat_ranking: context_ids.add(row[2]) @@ -74,8 +72,10 @@ class GetRankings: # trend, and will still be sorted on pos): # 2 B DONE! - #rankings.append({ 'stat': stat_name, 'ranking': stat_ranking }) - rankings[stat_name.lower()] = stat_ranking + # Add the 'maxsize' highest ranked benchmarks for this statistic: + rankings[stat_name.lower()] = ( + stat_ranking if (self.maxsize < 0) + else stat_ranking[:self.maxsize]) # Extract affected SHA-1s: |