Marc Weustink napisał(a):

darekM wrote:

Micha Nelissen napisał(a):

On Sun, 13 Nov 2005 17:37:18 +0100
darekm <[EMAIL PROTECTED]> wrote:

Index: lcl/include/wincontrol.inc
===================================================================
--- lcl/include/wincontrol.inc    (wersja 8136)
+++ lcl/include/wincontrol.inc    (kopia robocza)
@@ -3993,7 +3993,7 @@
begin
  if not HandleAllocated then
//Assert(False, Format('Trace:[TWinControl.GetHandle] %s(%s)', [ClassNAme, Name]))
-    ;
+
  HandleNeeded;
  Result := FHandle;
end;


That's obscure IMHO: it moves the HandleNeeded under the if.

Now HandleNeeded is invoked even if handle is allocated, what for
I think, it should be done only  when condition will be true
Now is:



This is actual code (not my proposition), I want change it (see patch).

  if not HandleAllocated then   ;
   HandleNeeded;


The if was meant for the assert and not the handle needed.
It doesn't make much sense to check twice. (and that why you just call HandleNeeded)

I know, then I was suggested remove one of if. You may remove condition, if You think that is better, but have both is nonsense.


Darek

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to