public List <ReadOnlyProposal> ForeachSorted()
        {
            List <ReadOnlyProposal> proposals = ProposalBuilder.GetSortedInsurances();
            List <ReadOnlyProposal> result    = new List <ReadOnlyProposal>(64); // cheating

            foreach (ReadOnlyProposal p in proposals)
            {
                if (p.InsuranceId == SearchedInsuranceId)
                {
                    result.Add(p);
                }
                else if (p.InsuranceId > SearchedInsuranceId)
                {
                    break;
                }
            }
            return(result);
        }
Пример #2
0
        public List <ReadOnlyProposal> ForSorted()
        {
            List <ReadOnlyProposal> proposals = ProposalBuilder.GetSortedInsurances();
            List <ReadOnlyProposal> result    = new List <ReadOnlyProposal>(64); // cheating

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