original_docstring: FilterCollector ignores filters that match no documents.
      The following function includes a patch submitted to whoosh in
      pull request #41.
      
docstring: FilterCollector ignores filters that match no documents.
  The following function includes a patch submitted to whoosh in
  pull request #41.
docstring_tokens: FilterCollector ignores filters that match no documents . The following function includes a patch submitted to whoosh in pull request #41 .
code: def fix_filter_collector():
      """FilterCollector ignores filters that match no documents.
      The following function includes a patch submitted to whoosh in
      pull request #41.
      """
  
      def FilterCollector_collect_matches(self):
          # pylint: disable=protected-access,attribute-defined-outside-init
          child = self.child
          _allow = self._allow
          _restrict = self._restrict
  
          if _allow is not None or _restrict is not None:
              filtered_count = self.filtered_count
              for sub_docnum in child.matches():
                  global_docnum = self.offset + sub_docnum
                  if ((_allow is not None and global_docnum not in _allow)
                      or (_restrict is not None and global_docnum in _restrict)):
                      filtered_count += 1
                      continue
                  child.collect(sub_docnum)
              self.filtered_count = filtered_count
          else:
              # If there was no allow or restrict set, don't do anything special,
              # just forward the call to the child collector
              child.collect_matches()
      FilterCollector.collect_matches = FilterCollector_collect_matches
code_tokens: def fix_filter_collector ( ) : def FilterCollector_collect_matches ( self ) : child = self . child _allow = self . _allow _restrict = self . _restrict if _allow is not None or _restrict is not None : filtered_count = self . filtered_count for sub_docnum in child . matches ( ) : global_docnum = self . offset + sub_docnum if ( ( _allow is not None and global_docnum not in _allow ) or ( _restrict is not None and global_docnum in _restrict ) ) : filtered_count += 1 continue child . collect ( sub_docnum ) self . filtered_count = filtered_count else : child . collect_matches ( ) FilterCollector . collect_matches = FilterCollector_collect_matches
short_docstring: FilterCollector ignores filters that match no documents.
short_docstring_tokens: FilterCollector ignores filters that match no documents .
comment: """FilterCollector ignores filters that match no documents.
      The following function includes a patch submitted to whoosh in
      pull request #41.
      """$SEP$# pylint: disable=protected-access,attribute-defined-outside-init$SEP$# If there was no allow or restrict set, don't do anything special,$SEP$# just forward the call to the child collector