MCPcopy Create free account
hub / github.com/ceph/ceph / setMatcher

Function setMatcher

qa/workunits/erasure-code/jquery.js:4833–4924  ·  view source on GitHub ↗
( preFilter, selector, matcher, postFilter, postFinder, postSelector )

Source from the content-addressed store, hash-verified

4831}
4832
4833function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
4834 if ( postFilter && !postFilter[ expando ] ) {
4835 postFilter = setMatcher( postFilter );
4836 }
4837 if ( postFinder && !postFinder[ expando ] ) {
4838 postFinder = setMatcher( postFinder, postSelector );
4839 }
4840 return markFunction(function( seed, results, context, xml ) {
4841 var temp, i, elem,
4842 preMap = [],
4843 postMap = [],
4844 preexisting = results.length,
4845
4846 // Get initial elements from seed or context
4847 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
4848
4849 // Prefilter to get matcher input, preserving a map for seed-results synchronization
4850 matcherIn = preFilter && ( seed || !selector ) ?
4851 condense( elems, preMap, preFilter, context, xml ) :
4852 elems,
4853
4854 matcherOut = matcher ?
4855 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
4856 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
4857
4858 // ...intermediate processing is necessary
4859 [] :
4860
4861 // ...otherwise use results directly
4862 results :
4863 matcherIn;
4864
4865 // Find primary matches
4866 if ( matcher ) {
4867 matcher( matcherIn, matcherOut, context, xml );
4868 }
4869
4870 // Apply postFilter
4871 if ( postFilter ) {
4872 temp = condense( matcherOut, postMap );
4873 postFilter( temp, [], context, xml );
4874
4875 // Un-match failing elements by moving them back to matcherIn
4876 i = temp.length;
4877 while ( i-- ) {
4878 if ( (elem = temp[i]) ) {
4879 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
4880 }
4881 }
4882 }
4883
4884 if ( seed ) {
4885 if ( postFinder || preFilter ) {
4886 if ( postFinder ) {
4887 // Get the final matcherOut by condensing this intermediate into postFinder contexts
4888 temp = [];
4889 i = matcherOut.length;
4890 while ( i-- ) {

Callers 1

matcherFromTokensFunction · 0.85

Calls 7

markFunctionFunction · 0.85
multipleContextsFunction · 0.85
condenseFunction · 0.85
spliceMethod · 0.80
pushMethod · 0.45
callMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected