Improvements lazarus / 39-Graphics ---------------------------------------------------------------------- apexcol · 2017-12-13 00:59 Hi, I think it would be a good idea to put a place where all experienced pascal programmers should give improvements for the FreePascal code. For example, I'd like FreePascal to change this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TPoint.Offset(dx,dy : Longint);begin  x:=x+dx;  y:=y+dy;end; on the file TYPSHRD.INC for this one... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TPoint.Offset(dx,dy : Longint);begin  inc(x, dx);  inc(y, dy);end;   Thanks in advance. ---------------------------------------------------------------------- avra · 2017-12-13 07:38 Well, experienced pascal programmers would be even more experienced once they learn to use trunk, create a patch and propose it into bugtracker: https://bugs.freepascal.org/view_all_bug_page.php http://wiki.freepascal.org/Creating_A_Patch ---------------------------------------------------------------------- Thaddy · 2017-12-13 07:47 Those experienced programmers usually also examine the assembler output to check if it makes any difference (Positive or negative) before they submit a patch. And discuss such syntax preferences first on the mailing list. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TPoint.Offset(dx,dy : Longint);begin  x += dx;  y += dy;end;      Is what I -might - prefer..... Just teasing... Note that in -04 all three generate the exact same code. Such a patch will probably be applied if you add inline, and in that case just because of inline...Otherwise probably not. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TPoint.Offset(dx,dy : Longint);inline; ---------------------------------------------------------------------- Leledumbo · 2017-12-13 10:10 Quote from: Thaddy on December 13, 2017, 08:47:22 amNote that in -04 all three generate the exact same code. No need to be that high, AFAIK even -O1 (or -O2) already optimizes that statement to single inc instruction. ---------------------------------------------------------------------- Thaddy · 2017-12-13 10:24 I did not check other optimizations. Just O4 and inline