Try to disable partial boolean evaluation with option {$B+}
--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be
----- Original Message -----
From: "Wilfried Mestdagh" <[EMAIL PROTECTED]>
To: "'Delphi-Talk Discussion List'" <[email protected]>
Sent: Wednesday, November 16, 2005 10:38 AM
Subject: strange optimization bug?
> Hello,
>
> I have a strange optimization bug and I wonder wy, also I wonder if
> there are similar optimizations in Delphi that I need to know of. I
> explain with a peace of code:
>
> if Foo.CheckForChanges then
> Foo.SaveToFile;
>
> procedure TFoo.CheckForChanges: boolean;
> var
> n: integer;
> begin
> Result := False;
> for n := 0 to Count - 1 do
> Result := Result or CheckAccount(Items[n]);
> end;
>
> What happens here is that as soon as 1 CheckAccount returns True then it
> stop calling CheckAccount. I solved this with increment a counter for
> each CheckAccount and Result := Counter > 0; But this kind of
> optimization is for me a bug, or is it not ? I discoverd this in D7,
> dont know about previous D versions, however I'm pretty sure I did
> similar things in other projects.
>
> ---
> Rgds, Wilfried
> http://www.mestdagh.biz
>
> __________________________________________________
> Delphi-Talk mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi-talk
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk