<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
<div id="smartTemplate4-template">Hi,<br>
<br>
<p>
<blockquote type="cite">This pattern is not inherently
efficient. Why should it be ?
</blockquote>
</p>
<p><br>
</p>
<p>It is not efficient, because of the pointless instruction!<br>
</p>
<br>
<br>
Bye,<br>
Benito </div>
<br>
<br>
<br>
<div class="moz-cite-prefix">Am 21.08.2017 um 08:39 schrieb Michael
Van Canneyt:<br>
</div>
<blockquote type="cite"
cite="mid:alpine.DEB.2.20.1708210837130.4240@home.telenet.be">
<br>
<br>
On Sun, 20 Aug 2017, Benito van der Zander wrote:
<br>
<br>
<blockquote type="cite">Hi,
<br>
<br>
why does fpc not remove the calculation of the return value of
inline functions, when the return value is unused?
<br>
<br>
For example
<br>
<br>
type TUtility = class
<br>
function doSomething: TUtility; inline;
<br>
end;
<br>
<br>
<br>
It is a popular pattern to add result := self; to _every_ method
(or result := @self in objects/records), so it can be chained as
dosomething().dosomething().dosomething(),.....
<br>
but one cannot use it with fpc efficiently, when it inserts too
many unnecessary instructions
<br>
</blockquote>
<br>
A strange statement.
<br>
<br>
This pattern is not inherently efficient. Why should it be ?
<br>
<br>
It's just something that boiled over from other languages and some
people
<br>
see it as a nifty way of writing code.
<br>
<br>
Michael.
<br>
_______________________________________________
<br>
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
<br>
</blockquote>
<br>
</body>
</html>