Recent

Author Topic: [CLOSED] Improvement of Destructor TComponent.Destroy;  (Read 1096 times)

lagprogramming

  • Sr. Member
  • ****
  • Posts: 405
[CLOSED] Improvement of Destructor TComponent.Destroy;
« on: November 21, 2023, 11:12:15 am »
rtl/objpas/classes/compon.inc has Destructor TComponent.Destroy;
In order to exit a loop, the original code sets a zero value to variable "I".
A patch has been attached that changes the line "I := 0;" with "Break;", increasing code readability.
« Last Edit: November 22, 2023, 05:28:54 pm by lagprogramming »

AlexTP

  • Hero Member
  • *****
  • Posts: 2398
    • UVviewsoft

AlexTP

  • Hero Member
  • *****
  • Posts: 2398
    • UVviewsoft
Re: Improvement of Destructor TComponent.Destroy;
« Reply #2 on: November 22, 2023, 07:09:22 am »
Declined at FPC bugtracker.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Improvement of Destructor TComponent.Destroy;
« Reply #3 on: November 24, 2023, 05:49:54 am »
Declined at FPC bugtracker.
Expected. For those who live long enough with Pascal, break and continue are indeed not inline with Pascal spirit. Most if not all of my softwares don't use it and readability enhancement is subjective.

 

TinyPortal © 2005-2018