Skip to content

Commit

Permalink
Clone object directly instead of calling copy()
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Oct 23, 2024
1 parent 3990e64 commit 18eedb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ public function every( \Closure $callback ) : bool
*/
public function except( $keys ) : self
{
return $this->copy()->remove( $keys );
return ( clone $this )->remove( $keys );
}


Expand Down Expand Up @@ -5485,7 +5485,7 @@ public function where( string $key, string $op, $value ) : self
*/
public function with( $key, $value ) : self
{
return $this->copy()->set( $key, $value );
return ( clone $this )->set( $key, $value );
}


Expand Down

0 comments on commit 18eedb1

Please sign in to comment.