File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,11 @@ public function setOldNew(array $old, array $new): self
9292 */
9393 public function setOld (array $ old ): self
9494 {
95- $ this ->old = $ old ;
96- $ this ->sequenceMatcher ->setSeq1 ($ old );
97- $ this ->resetCachedResults ();
95+ if ($ this ->old !== $ old ) {
96+ $ this ->old = $ old ;
97+ $ this ->sequenceMatcher ->setSeq1 ($ old );
98+ $ this ->resetCachedResults ();
99+ }
98100
99101 return $ this ;
100102 }
@@ -108,9 +110,11 @@ public function setOld(array $old): self
108110 */
109111 public function setNew (array $ new ): self
110112 {
111- $ this ->new = $ new ;
112- $ this ->sequenceMatcher ->setSeq2 ($ new );
113- $ this ->resetCachedResults ();
113+ if ($ this ->new !== $ new ) {
114+ $ this ->new = $ new ;
115+ $ this ->sequenceMatcher ->setSeq2 ($ new );
116+ $ this ->resetCachedResults ();
117+ }
114118
115119 return $ this ;
116120 }
You can’t perform that action at this time.
0 commit comments