refactor: Use set.union() to combine set objects

This commit is contained in:
Takeshi KOMIYA 2018-09-02 16:33:26 +09:00
parent 96e1c70b39
commit 9d7b1b756a

View File

@ -22,7 +22,7 @@ from os import path
from docutils.frontend import OptionParser from docutils.frontend import OptionParser
from docutils.utils import Reporter, get_source_line from docutils.utils import Reporter, get_source_line
from six import BytesIO, itervalues, class_types, next from six import BytesIO, itervalues, class_types, next
from six.moves import cPickle as pickle, reduce from six.moves import cPickle as pickle
from sphinx import addnodes, versioning from sphinx import addnodes, versioning
from sphinx.deprecation import RemovedInSphinx20Warning from sphinx.deprecation import RemovedInSphinx20Warning
@ -914,7 +914,7 @@ class BuildEnvironment(object):
def check_consistency(self): def check_consistency(self):
# type: () -> None # type: () -> None
"""Do consistency checks.""" """Do consistency checks."""
included = reduce(lambda x, y: x | y, self.included.values(), set()) # type: Set[unicode] # NOQA included = set().union(*self.included.values()) # type: ignore
for docname in sorted(self.all_docs): for docname in sorted(self.all_docs):
if docname not in self.files_to_rebuild: if docname not in self.files_to_rebuild:
if docname == self.config.master_doc: if docname == self.config.master_doc: