-
Notifications
You must be signed in to change notification settings - Fork 10
Greatly reduces the usage of Unbounded_String #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… String interface. Cleanup
| ------------------ | ||
| -- Format_Input -- | ||
| ------------------ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen a lot of Ada with blocks like this, but I find it incredibly distracting, especially when renaming the subprogram will likely result in needing to modify this comment header as well.
| declare | ||
| US : constant ASU.Unbounded_String := V ( Positive (Index)); | ||
| S : constant String := ASU.To_String (US); | ||
| -- US : constant String := V ( Positive (Index)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed.
| New_Min : constant Positive := Positive'Max (A.Minimum, B.Minimum); | ||
| New_Max : constant Positive := Positive'Min (A.Maximum, B.Maximum); | ||
| use Ada.Strings.Unbounded; | ||
| -- use Ada.Strings.Unbounded; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed.
| end if; | ||
| end loop; | ||
|
|
||
| return To_String (Result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it results in an additional copy to the stack on every call to this function.
|
This changes 10% of the code base. What is the purpose of this change? Does it result in a measurable performance increase (as seen with Yes, there is a lot of copying between General comments about this project's style:
|
No description provided.