Ejemplo n.º 1
0
        public void Boxing()
        {
            var l1 = new List <object>();
            var l2 = new List <object>();

            var count = 0;

            for (int i = 0; i < Iterations; i++)
            {
                var v = _boxedValuesGenerator.GetNext();
                l1.Add(v);
                if (i % 10 == 0)
                {
                    l2.Add(v);
                }

                if (l1.Count > 1_000_000)
                {
                    l1.Clear();
                }

                if (v is bool b)
                {
                    count++;
                }
            }
        }
Ejemplo n.º 2
0
        public void Boxing()
        {
            var count = 0;

            for (int i = 0; i < Iterations; i++)
            {
                var v = _boxedValuesGenerator.GetNext();

                if (v is bool b)
                {
                    count++;
                }
            }
        }