Bug 3018: remove calls to keys() and values() dictionary method where possible
svn: r12579
This commit is contained in:
@@ -132,7 +132,8 @@ class GenChart(object):
|
||||
new_y = 0
|
||||
for key, i in self.array.iteritems():
|
||||
old_y = key
|
||||
if self.not_blank(i.values()):
|
||||
print __name__, i
|
||||
if self.not_blank(i.itervalues()):
|
||||
self.compress_map[old_y] = new_y
|
||||
new_array[new_y] = i
|
||||
x = 0
|
||||
|
||||
@@ -534,19 +534,15 @@ class StatisticsChart(Report):
|
||||
"""creates & stores a sorted index for the items"""
|
||||
|
||||
# sort by item keys
|
||||
index = data.keys()
|
||||
index.sort()
|
||||
if reverse:
|
||||
index.reverse()
|
||||
index = sorted(data, reverse=True if reverse else False)
|
||||
|
||||
if sort == _options.SORT_VALUE:
|
||||
# set for the sorting function
|
||||
self.lookup_items = data
|
||||
|
||||
# then sort by value
|
||||
index.sort(self.lookup_compare)
|
||||
if reverse:
|
||||
index.reverse()
|
||||
index.sort(self.lookup_compare,
|
||||
reverse=True if reverse else False)
|
||||
|
||||
return index
|
||||
|
||||
|
||||
Reference in New Issue
Block a user