<commit_before>var _ = require('_'),

    _array = require('../array'),
    _regex = require('../../regex'),
    _cache = require('../../cache'),

    _queryCache = _cache(),

    Selector = require('./Selector'),
    _normalizeSelector = require('./normalizeSelector');

var Query = function(str) {
    str = _normalizeSelector(str);

    var result = _regex.selector.commandSplit(str);
    this._selectors = _.fastmap(result, function(selector) {
        console.log('result: ', result);
        console.log('str: ', str);
        return new Selector(selector);
    });
};
Query.prototype = {
    exec: function(arr, isNew) {
        var result = [],
            idx = 0, length = isNew ? 1 : arr.length;
        for (; idx < length; idx++) {
            result.push(this._find(arr[idx]));
        }

        result = _.flatten(result);
        _array.elementSort(result);
        return result;
    },
    _find: function(context) {
        var result = [],
            selectors = this._selectors,
            idx = 0, length = selectors.length;
        for (; idx < length; idx++) {
            result.push(selectors[idx].exec(context));
        }

        return result;
    }
};
<commit_msg>Use _.map() instead of _.fastmap() in Query.js<commit_after>var _ = require('_'),

    _array = require('../array'),
    _regex = require('../../regex'),
    _cache = require('../../cache'),

    _queryCache = _cache(),

    Selector = require('./Selector'),
    _normalizeSelector = require('./normalizeSelector');

var Query = function(str) {
    str = _normalizeSelector(str);

    var result = _regex.selector.commandSplit(str);
    this._selectors = _.map(result, function(selector) {
        console.log('result: ', result);
        console.log('str: ', str);
        return new Selector(selector);
    });
};
Query.prototype = {
    exec: function(arr, isNew) {
        var result = [],
            idx = 0, length = isNew ? 1 : arr.length;
        for (; idx < length; idx++) {
            result.push(this._find(arr[idx]));
        }

        result = _.flatten(result);
        _array.elementSort(result);
        return result;
    },
    _find: function(context) {
        var result = [],
            selectors = this._selectors,
            idx = 0, length = selectors.length;
        for (; idx < length; idx++) {
            result.push(selectors[idx].exec(context));
        }

        return result;
    }
};

{'fraction_non_alphanumeric': 0.16371134020618558, 'fraction_numerical': 0.002474226804123711, 'mean_word_length': 2.16710182767624, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4595767', 'n_tokens_mistral': 719, 'n_tokens_neox': 694, 'n_words': 148}