From ce2ba2c8bdd7070d7688eff83173b6725c0fe657 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Fri, 18 Apr 2025 01:35:24 +1200 Subject: Removed pointless Min/Max functions --- src/displays.adb | 8 ++++---- src/misc.adb | 23 +---------------------- src/misc.ads | 10 ++-------- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/src/displays.adb b/src/displays.adb index fec8ded..9893db3 100644 --- a/src/displays.adb +++ b/src/displays.adb @@ -26,8 +26,8 @@ package body Displays is Text : in String) return Display is - My_Width : constant Integer := Misc.Max (Message_Box_Width, W); - My_Height : constant Integer := Misc.Max (Message_Box_Height + Stat_Box_Height, H); + My_Width : constant Integer := Integer'Max (Message_Box_Width, W); + My_Height : constant Integer := Integer'Max (Message_Box_Height + Stat_Box_Height, H); begin return This : Display := (WD.Forge.Create (X, Y, My_Width, My_Height, Text) @@ -99,11 +99,11 @@ package body Displays is (This : in out Display) is New_Width : constant Integer := - Misc.Max (Message_Box_Width, This.Current_Grid.Get_W); + Integer'Max (Message_Box_Width, This.Current_Grid.Get_W); New_Height : constant Integer := Message_Box_Height + This.Current_Grid.Get_H + Stat_Box_Height; Grid_X : constant Integer := - Misc.Max (0, (Message_Box_Width - This.Current_Grid.Get_W) / 2); + Integer'Max (0, (Message_Box_Width - This.Current_Grid.Get_W) / 2); begin This.Current_Grid.Reposition (Grid_X, 0); This.Message_Box.Resize (New_Width, This.Message_Box.Get_H); diff --git a/src/misc.adb b/src/misc.adb index 0a16450..009836c 100644 --- a/src/misc.adb +++ b/src/misc.adb @@ -9,28 +9,7 @@ package body Misc is - function Max - (A, B : in Integer) - return Integer is - begin - if B > A then - return B; - else - return A; - end if; - end Max; - - - function Min - (A, B : in Integer) - return Integer is - begin - if B < A then - return B; - else - return A; - end if; - end Min; + -- null end Misc; diff --git a/src/misc.ads b/src/misc.ads index 679f3f5..7108f63 100644 --- a/src/misc.ads +++ b/src/misc.ads @@ -15,16 +15,10 @@ private with package Misc is - Origin, Image_Path, Level_Path : constant String; - + pragma Elaborate_Body; - function Max - (A, B : in Integer) - return Integer; - function Min - (A, B : in Integer) - return Integer; + Origin, Image_Path, Level_Path : constant String; private -- cgit