Browse Source

* Fix uninitialized result warnings

michael 4 years ago
parent
commit
d19e385f71
1 changed files with 2 additions and 0 deletions
  1. 2 0
      packages/rtl/generics.collections.pas

+ 2 - 0
packages/rtl/generics.collections.pas

@@ -1300,6 +1300,7 @@ end;
 function TDictionary<TKey, TValue>.ExtractPair(const Key: TKey): TMyPair;
 function TDictionary<TKey, TValue>.ExtractPair(const Key: TKey): TMyPair;
 
 
 begin
 begin
+  Result:=Default(TMyPair);
   if FMap.Has(Key) then
   if FMap.Has(Key) then
     begin
     begin
     Result.Create(Key,TValue(FMap.get(key)));
     Result.Create(Key,TValue(FMap.get(key)));
@@ -1419,6 +1420,7 @@ Var
 
 
 begin
 begin
   A:=TJSValueDynArray(FVal.Value);
   A:=TJSValueDynArray(FVal.Value);
+  Result:=Default(TMyPair);
   Result.Create(TKey(A[0]),TValue(A[1]));
   Result.Create(TKey(A[0]),TValue(A[1]));
 end;
 end;