From fb207dd5f9ce1bfa382e437e2187c01936bf2f47 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Mon, 15 Jul 2024 13:09:24 +0300 Subject: [PATCH] fix: Removed redundant iterator in sort map (#15184) --- packages/jest-diff/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jest-diff/src/index.ts b/packages/jest-diff/src/index.ts index 7c16364bcaae..4b87be7d720f 100644 --- a/packages/jest-diff/src/index.ts +++ b/packages/jest-diff/src/index.ts @@ -122,11 +122,11 @@ function comparePrimitive( } function sortMap(map: Map) { - return new Map([...map.entries()].sort()); + return new Map([...map].sort()); } function sortSet(set: Set) { - return new Set([...set.values()].sort()); + return new Set([...set].sort()); } function compareObjects(