Преглед на файлове

Revert commit 663ee7bc2007a22c48f97927afd4086cc8e56490 as it's simply not allowed to set an object instance value twice no matter if it's the same object instance or not.

(cherry picked from commit 43f4904d74d535d7188d6703ea428b612e765753)
Sven/Sarah Barth преди 2 години
родител
ревизия
8ab5cef8cc
променени са 2 файла, в които са добавени 1 реда и са изтрити 16 реда
  1. 0 14
      packages/rtl-generics/src/inc/generics.dictionaries.inc
  2. 1 2
      packages/rtl-generics/src/inc/generics.dictionariesh.inc

+ 0 - 14
packages/rtl-generics/src/inc/generics.dictionaries.inc

@@ -2233,20 +2233,6 @@ begin
   FOwnerships := AOwnerships;
 end;
 
-procedure TObjectOpenAddressingLP<OPEN_ADDRESSING_CONSTRAINTS>.SetValue(var AValue: TValue; constref ANewValue: TValue);
-var
-  LOldValue: TValue;
-begin
-  if TObject((@AValue)^) <> TObject((@ANewValue)^) then
-  begin
-    LOldValue := AValue;
-    AValue := ANewValue;
-
-    ValueNotify(LOldValue, cnRemoved);
-    ValueNotify(ANewValue, cnAdded);
-  end;
-end;
-
 procedure TObjectOpenAddressingLP<OPEN_ADDRESSING_CONSTRAINTS>.KeyNotify(
   constref AKey: TKey; ACollectionNotification: TCollectionNotification);
 begin

+ 1 - 2
packages/rtl-generics/src/inc/generics.dictionariesh.inc

@@ -98,7 +98,7 @@ type
     procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); virtual;
     procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); virtual;
     procedure PairNotify(constref APair: TDictionaryPair; ACollectionNotification: TCollectionNotification); inline;
-    procedure SetValue(var AValue: TValue; constref ANewValue: TValue); dynamic;
+    procedure SetValue(var AValue: TValue; constref ANewValue: TValue);
   public
     property OnKeyNotify: TCollectionNotifyEvent<TKey> read FOnKeyNotify write FOnKeyNotify;
     property OnValueNotify: TCollectionNotifyEvent<TValue> read FOnValueNotify write FOnValueNotify;
@@ -597,7 +597,6 @@ type
   private
     FOwnerships: TDictionaryOwnerships;
   protected
-    procedure SetValue(var AValue: TValue; constref ANewValue: TValue); override;
     procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); override;
     procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); override;
   public