<commit_before>﻿using ClassOperations.Attributes;

namespace ClassOperations
{
    public class PropertyMatcher<TParent, TChild> where TParent : class 
                                                  where TChild : class
    {
        private readonly TParent _parent;
        private readonly TChild _child;
        public PropertyMatcher(TParent parent, TChild child)
        {
            _parent = parent;
            _child = child;
        }

        public TChild GenerateMatchedObject()
        {
            var childProperties = _child.GetType().GetProperties();
            foreach (var childProperty in childProperties)
            {
                var attributesForProperty = childProperty.GetCustomAttributes(typeof(MatchParentAttribute), true);
                var isOfTypeMatchParentAttribute = false;

                MatchParentAttribute currentAttribute = null;

                foreach (var attribute in attributesForProperty)
                {
                    if (attribute.GetType() == typeof(MatchParentAttribute))
                    {
                        isOfTypeMatchParentAttribute = true;
                        currentAttribute = (MatchParentAttribute) attribute;
                        break;
                    }
                }

                if (isOfTypeMatchParentAttribute)
                {
                    var parentProperties = _parent.GetType().GetProperties();
                    object parentPropertyValue = null;
                    foreach (var parentProperty in parentProperties)
                    {
                        if (parentProperty.Name == currentAttribute.ParentPropertyName)
                        {
                            parentPropertyValue = parentProperty.GetValue(_parent);
                        }
                    }
                    childProperty.SetValue(_child, parentPropertyValue);
                }
            }

            return _child;
        }
    }
}<commit_msg>Removed the return value of property matcher<commit_after>﻿using ClassOperations.Attributes;

namespace ClassOperations
{
    public class PropertyMatcher<TParent, TChild> where TParent : class 
                                                  where TChild : class
    {
        public void GenerateMatchedObject(TParent parent, TChild child)
        {
            var childProperties = child.GetType().GetProperties();
            foreach (var childProperty in childProperties)
            {
                var attributesForProperty = childProperty.GetCustomAttributes(typeof(MatchParentAttribute), true);
                var isOfTypeMatchParentAttribute = false;

                MatchParentAttribute currentAttribute = null;

                foreach (var attribute in attributesForProperty)
                {
                    if (attribute.GetType() == typeof(MatchParentAttribute))
                    {
                        isOfTypeMatchParentAttribute = true;
                        currentAttribute = (MatchParentAttribute) attribute;
                        break;
                    }
                }

                if (isOfTypeMatchParentAttribute)
                {
                    var parentProperties = parent.GetType().GetProperties();
                    object parentPropertyValue = null;
                    foreach (var parentProperty in parentProperties)
                    {
                        if (parentProperty.Name == currentAttribute.ParentPropertyName)
                        {
                            parentPropertyValue = parentProperty.GetValue(parent);
                        }
                    }
                    childProperty.SetValue(child, parentPropertyValue);
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.057226510513707744, 'fraction_numerical': 0.0, 'mean_word_length': 1.3472829481574016, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5304851', 'n_tokens_mistral': 772, 'n_tokens_neox': 716, 'n_words': 166}