Skip to content

Commit f54440c

Browse files
committed
changed array aggregates in Init_Countries to extended return statement
1 parent 8c45817 commit f54440c

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

alire.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ tags = [ "countries", "iso-1366" ]
88
authors = ["AJ Ianozi"]
99
maintainers = ["AJ Ianozi <aj@ianozi.com>"]
1010
maintainers-logins = ["AJ-Ianozi"]
11-
12-
[build-switches]
13-
"*".ada_version = "Ada2022"

generator/src/countries.adb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,12 @@ package body Countries is
442442
Put_Line (F, " return From_Alpha2 (Alpha2_Code (Code));");
443443
Put_Line (F, " end From_Country_Code;");
444444
Put_Line (F, " function Init_Countries return All_Countries is");
445-
Put_Line (F, " Result : constant All_Countries :=");
446-
Put_Line (F, " [for X in Country_Key'Range => (Key => X)];");
447445
Put_Line (F, " begin");
448-
Put_Line (F, " return Result;");
446+
Put_Line (F, " return Result : All_Countries do");
447+
Put_Line (F, " for X in Country_Key'Range loop");
448+
Put_Line (F, " Result (X) := (Key => X);");
449+
Put_Line (F, " end loop;");
450+
Put_Line (F, " end return;");
449451
Put_Line (F, " end Init_Countries;");
450452
Put_Line (F, " -- *** End Creation Functions ***");
451453
Put_Line (F, "");

src/iso-countries.adb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,10 +1060,12 @@ package body ISO.Countries is
10601060
return From_Alpha2 (Alpha2_Code (Code));
10611061
end From_Country_Code;
10621062
function Init_Countries return All_Countries is
1063-
Result : constant All_Countries :=
1064-
[for X in Country_Key'Range => (Key => X)];
10651063
begin
1066-
return Result;
1064+
return Result : All_Countries do
1065+
for X in Country_Key'Range loop
1066+
Result (X) := (Key => X);
1067+
end loop;
1068+
end return;
10671069
end Init_Countries;
10681070
-- *** End Creation Functions ***
10691071

0 commit comments

Comments
 (0)