Skip to content

Commit 3b44926

Browse files
committed
Save bytes
1 parent a31fa69 commit 3b44926

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/diff/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export function diff(
249249
c.state = c._nextState;
250250

251251
if (c.getChildContext != NULL) {
252-
globalContext = assign(assign({}, globalContext), c.getChildContext());
252+
globalContext = assign({}, globalContext, c.getChildContext());
253253
}
254254

255255
if (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {

src/util.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,7 @@ import { EMPTY_ARR } from './constants';
22

33
export const isArray = Array.isArray;
44
export const slice = EMPTY_ARR.slice;
5-
6-
/**
7-
* Assign properties from `props` to `obj`
8-
* @template O, P The obj and props types
9-
* @param {O} obj The object to copy properties to
10-
* @param {P} props The object to copy properties from
11-
* @returns {O & P}
12-
*/
13-
export function assign(obj, props) {
14-
// @ts-expect-error We change the type of `obj` to be `O & P`
15-
for (let i in props) obj[i] = props[i];
16-
return /** @type {O & P} */ (obj);
17-
}
5+
export const assign = Object.assign;
186

197
/**
208
* Remove a child node from its parent if attached.

0 commit comments

Comments
 (0)