зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1547730 - Use six.moves.reduce for reduce() r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D28109 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c5571e7a5c
Коммит
241fd2ab7d
|
@ -718,7 +718,7 @@ class Preprocessor:
|
||||||
for i in range(1, len(lst), 2):
|
for i in range(1, len(lst), 2):
|
||||||
lst[i] = vsubst(lst[i])
|
lst[i] = vsubst(lst[i])
|
||||||
lst.append('\n') # add back the newline
|
lst.append('\n') # add back the newline
|
||||||
self.write(reduce(lambda x, y: x+y, lst, ''))
|
self.write(six.moves.reduce(lambda x, y: x+y, lst, ''))
|
||||||
|
|
||||||
def do_literal(self, args):
|
def do_literal(self, args):
|
||||||
self.write(args + '\n')
|
self.write(args + '\n')
|
||||||
|
|
|
@ -567,8 +567,8 @@ class JarWriter(object):
|
||||||
end = JarCdirEnd()
|
end = JarCdirEnd()
|
||||||
end['disk_entries'] = len(self._contents)
|
end['disk_entries'] = len(self._contents)
|
||||||
end['cdir_entries'] = end['disk_entries']
|
end['cdir_entries'] = end['disk_entries']
|
||||||
end['cdir_size'] = reduce(lambda x, y: x + y[0].size,
|
end['cdir_size'] = six.moves.reduce(lambda x, y: x + y[0].size,
|
||||||
self._contents.values(), 0)
|
self._contents.values(), 0)
|
||||||
# On optimized archives, store the preloaded size and the central
|
# On optimized archives, store the preloaded size and the central
|
||||||
# directory entries, followed by the first end of central directory.
|
# directory entries, followed by the first end of central directory.
|
||||||
if preload_size:
|
if preload_size:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче