Index: tools/smaz.adb ================================================================== --- tools/smaz.adb +++ tools/smaz.adb @@ -323,11 +323,12 @@ return Dictionary; with function Worst_Element (Dict : in Dictionary; Counts : in Dictionary_Counts; - Method : in Methods) + Method : in Methods; + First, Last : in Dictionary_Entry) return Dictionary_Entry; package Dictionary_Subprograms is package Holders is new Ada.Containers.Indefinite_Holders (Dictionary); @@ -453,11 +454,13 @@ for Word of Handler.Forced_Words loop if not Is_In_Dict (Actual_Dict, Word) then declare Worst_Index : constant Dictionary_Entry - := Worst_Element (Actual_Dict, Counts, Method); + := Worst_Element + (Actual_Dict, Counts, Method, + Dictionary_Entry'First, Last_Code (Actual_Dict)); New_Dict : constant Dictionary := Replace_Element (Current.Element, Worst_Index, Word); begin Ada.Text_IO.Put_Line (Ada.Text_IO.Current_Error, @@ -562,11 +565,13 @@ use type Ada.Streams.Stream_Element_Offset; New_Value : Ada.Strings.Unbounded.Unbounded_String; New_Position : String_Lists.Cursor; Worst_Index : constant Dictionary_Entry - := Worst_Element (Dict.Element, Counts, Method); + := Worst_Element + (Dict.Element, Counts, Method, + Dictionary_Entry'First, Last_Code (Dict.Element)); Worst_Value : constant String := Dict_Entry (Dict.Element, Worst_Index); Worst_Count : constant String_Count := Counts (Worst_Index); Base : constant Dictionary := Remove_Element (Dict.Element, Worst_Index);