Example #1
0
        // removed, not testing loop speed
        //[Benchmark]
        public List <ReadOnlyProposal> KeyedSorted()
        {
            Dictionary <int, ImmutableArray <ReadOnlyProposal> > proposalsByKey = ProposalBuilder.GetKeyedSortedInsurances();
            List <ReadOnlyProposal> result = new List <ReadOnlyProposal>();

            var proposals = proposalsByKey[SearchedInsuranceId];

            for (int i = 0; i < proposals.Length; i++)
            {
                ReadOnlyProposal p = proposals[i];
                if (p.NetPremium > SearchedNetPremium)
                {
                    result.Add(p);
                }
                else
                {
                    break;
                }
            }

            return(result);
        }
        // removed, not testing loop speed
        //[Benchmark]
        public ImmutableArray <ReadOnlyProposal> Keyed()
        {
            Dictionary <int, ImmutableArray <ReadOnlyProposal> > proposals = ProposalBuilder.GetKeyedSortedInsurances();

            return(proposals[1]);
        }