<commit_before><?php

class Vps_Component_Generator_Static extends Vps_Component_Generator_Abstract
{
    protected $_idSeparator = '-';

    public function getChildIds($parentData, $constraints = array())
    {
        $ret = parent::getChildIds($parentData, $constraints);
        if (!$parentData) {
            throw new Vps_Exception("no parentData for getChildIds is not (yet) implemented");
        }
        foreach ($this->_fetchKeys($parentData, $constraints) as $key) {
            $ret[] = $this->_idSeparator . $key;
        }
        return $ret;
    }
    public function getChildData($parentData, $constraints = array())
    {
        if (isset($this->_settings['unique']) && $this->_settings['unique']) {
            $component = $parentData;
            while ($component && $component->componentClass != $this->_class) {
                if ($component->componentClass != $this->_class) {
                    foreach ($component->getRecursiveChildComponents(array('page' => false, 'unique' => true)) as $c) {
                        if ($c->getParent()->componentClass == $this->_class) {
                            $component = $c->getParent();
                        }
                    }
                }
                if ($component->componentClass != $this->_class) {
                    if ($component->parent instanceof Vps_Component_Data_Root) {
                        $component = $component->getParent();
                    } else {
                        $component = $component->getParentPage();
                    }
                }
            }
            if ($component) {
                $parentData = $component;
            } else {
                $component = $this->_settings['generator'];
                throw new Vps_Exception("Couldn't find unique component '$component'");
            }
        }
        $ret = parent::getChildData($parentData, $constraints);
        if (!$parentData) {
            if (isset($constraints['id'])) {
                //Performance: wenn id contraint schauen ob es überhaupt was gibt
                //wenn nicht parentDatas nicht ermitteln (kann aufwändig sein)
                $id = substr($constraints['id'], 1);
                if (substr($constraints['id'], 0, 1) == $this->_idSeparator || !isset($this->_settings['component'][$id])) {
                    return $ret;<commit_msg>Performanceverbesserung bei Unique - ein bisschen halt<commit_after><?php

class Vps_Component_Generator_Static extends Vps_Component_Generator_Abstract
{
    protected $_idSeparator = '-';

    public function getChildIds($parentData, $constraints = array())
    {
        $ret = parent::getChildIds($parentData, $constraints);
        if (!$parentData) {
            throw new Vps_Exception("no parentData for getChildIds is not (yet) implemented");
        }
        foreach ($this->_fetchKeys($parentData, $constraints) as $key) {
            $ret[] = $this->_idSeparator . $key;
        }
        return $ret;
    }
    public function getChildData($parentData, $constraints = array())
    {
        if (isset($this->_settings['unique']) && $this->_settings['unique']) {
            $component = $parentData;
            while ($component && $component->componentClass != $this->_class) {
                if ($component->componentClass != $this->_class) {
                    foreach ($component->getRecursiveChildComponents(array('page' => false, 'unique' => true, 'inherit' => true)) as $c) {
                        if ($c->getParent()->componentClass == $this->_class) {
                            $component = $c->getParent();
                        }
                    }
                }
                if ($component->componentClass != $this->_class) {
                    if ($component->parent instanceof Vps_Component_Data_Root) {
                        $component = $component->getParent();
                    } else {
                        $component = $component->getParentPage();
                    }
                }
            }
            if ($component) {
                $parentData = $component;
            } else {
                $component = $this->_settings['generator'];
                throw new Vps_Exception("Couldn't find unique component '$component'");
            }
        }
        $ret = parent::getChildData($parentData, $constraints);
        if (!$parentData) {
            if (isset($constraints['id'])) {
                //Performance: wenn id contraint schauen ob es überhaupt was gibt
                //wenn nicht parentDatas nicht ermitteln (kann aufwändig sein)
                $id = substr($constraints['id'], 1);
                if (substr($constraints['id'], 0, 1) == $this->_idSeparator || !isset($this->_settings['component'][$id])) {
                    return $ret;
{'fraction_non_alphanumeric': 0.13466334164588528, 'fraction_numerical': 0.0012468827930174563, 'mean_word_length': 1.8328428487345498, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 50, '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': '1988673', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1183, 'n_words': 262}