Browse Source

* Change some code that results in browser warning about unreachable code (bug ID 37246)

michael 5 years ago
parent
commit
df8e44ef3e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/rtl/system.pas

+ 2 - 2
packages/rtl/system.pas

@@ -1045,6 +1045,7 @@ end;
 
 function TObject.GetInterfaceByStr(const iidstr: String; out obj): boolean;
 begin
+  Result:=false;
   if not TJSObj(IObjectInstance)['$str'] then
     TJSObj(IObjectInstance)['$str']:=GUIDToString(IObjectInstance);
   if iidstr = TJSObj(IObjectInstance)['$str'] then
@@ -1055,9 +1056,8 @@ begin
   asm
     var i = rtl.getIntfG(this,iidstr,2);
     obj.set(i);
-    return i!==null;
+    Result=(i!==null);
   end;
-  Result:=false;
 end;
 
 function TObject.GetInterfaceWeak(const iid: TGuid; out obj): boolean;