From 52eb6622ee81c50dd41cfbc8ba53cc210c0e9b1e Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Wed, 5 Jul 2017 21:52:49 +1000 Subject: Simplified Bundle_Containers to use an array instead of a Map --- src/stv.adb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/stv.adb') diff --git a/src/stv.adb b/src/stv.adb index eb132cc..29b18c9 100644 --- a/src/stv.adb +++ b/src/stv.adb @@ -237,15 +237,18 @@ begin -- Set up and run the election singleton declare + subtype Valid_CandidateID is Candidates.CandidateID + range Candidate_Data.First_Index .. Candidate_Data.Last_Index; + package Given_Prefs is new Preferences - (Pref_Size => Integer (Below_Ballot.Length), - Above_Ballot => Above_Ballot, + (Above_Ballot => Above_Ballot, Below_Ballot => Below_Ballot); package Vote_Bundles is new Bundles (Given_Prefs => Given_Prefs); - package Vote_Bundle_Containers is new Vote_Bundles.Containers; + package Vote_Bundle_Containers is new Vote_Bundles.Containers + (Candidate_Range => Valid_CandidateID); package This_Election is new Election (Given_Bundles => Vote_Bundles, -- cgit