From b30a10f5c5229c10b7f1da8350f360fea1fdb465 Mon Sep 17 00:00:00 2001 From: Tirth Date: Thu, 30 Jan 2025 17:16:02 +0530 Subject: [PATCH 1/4] Update hash_map.dart --- sdk/lib/collection/hash_map.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/lib/collection/hash_map.dart b/sdk/lib/collection/hash_map.dart index d266d60db163..b08a683fa60d 100644 --- a/sdk/lib/collection/hash_map.dart +++ b/sdk/lib/collection/hash_map.dart @@ -52,7 +52,7 @@ typedef _Hasher = int Function(K object); /// planets.addAll({4: 'Mars'}); /// final gasGiants = {6: 'Jupiter', 5: 'Saturn'}; /// planets.addEntries(gasGiants.entries); -/// print(planets); // fx {5: Saturn, 6: Jupiter, 3: Earth, 4: Mars} +/// print(planets); // fx {3: Earth, 4: Mars, 6: Jupiter, 5: Saturn} /// ``` /// To check if the map is empty, use [isEmpty] or [isNotEmpty]. /// To find the number of map entries, use [length]. @@ -64,10 +64,10 @@ typedef _Hasher = int Function(K object); /// ```dart continued /// planets.forEach((key, value) { /// print('$key \t $value'); -/// // 5 Saturn -/// // 4 Mars /// // 3 Earth +/// // 4 Mars /// // 6 Jupiter +/// // 5 Saturn /// }); /// ``` /// To check whether the map has an entry with a specific key, use [containsKey]. @@ -84,8 +84,8 @@ typedef _Hasher = int Function(K object); /// To remove an entry with a specific key, use [remove]. /// ```dart continued /// final removeValue = planets.remove(5); -/// print(removeValue); // Jupiter -/// print(planets); // fx {4: Mars, 3: Earth, 5: Saturn} +/// print(removeValue); // Saturn +/// print(planets); // fx {3: Earth, 4: Mars, 6: Jupiter} /// ``` /// To remove multiple entries at the same time, based on their keys and values, /// use [removeWhere]. From 1f25980c803e29270a63b63d17c19c1e3f2f24aa Mon Sep 17 00:00:00 2001 From: Tirth Date: Fri, 31 Jan 2025 14:57:55 +0530 Subject: [PATCH 2/4] Update hash_map.dart --- sdk/lib/collection/hash_map.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/lib/collection/hash_map.dart b/sdk/lib/collection/hash_map.dart index b08a683fa60d..0eb9814b4858 100644 --- a/sdk/lib/collection/hash_map.dart +++ b/sdk/lib/collection/hash_map.dart @@ -52,7 +52,7 @@ typedef _Hasher = int Function(K object); /// planets.addAll({4: 'Mars'}); /// final gasGiants = {6: 'Jupiter', 5: 'Saturn'}; /// planets.addEntries(gasGiants.entries); -/// print(planets); // fx {3: Earth, 4: Mars, 6: Jupiter, 5: Saturn} +/// print(planets); // fx {5: Saturn, 6: Jupiter, 3: Earth, 4: Mars} /// ``` /// To check if the map is empty, use [isEmpty] or [isNotEmpty]. /// To find the number of map entries, use [length]. From 51892310e36784a5808ec921bb1989f716764081 Mon Sep 17 00:00:00 2001 From: Tirth Date: Fri, 31 Jan 2025 14:58:56 +0530 Subject: [PATCH 3/4] Update hash_map.dart --- sdk/lib/collection/hash_map.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/lib/collection/hash_map.dart b/sdk/lib/collection/hash_map.dart index 0eb9814b4858..de8945169d7c 100644 --- a/sdk/lib/collection/hash_map.dart +++ b/sdk/lib/collection/hash_map.dart @@ -64,10 +64,10 @@ typedef _Hasher = int Function(K object); /// ```dart continued /// planets.forEach((key, value) { /// print('$key \t $value'); -/// // 3 Earth +/// // 5 Saturn /// // 4 Mars +/// // 3 Earth /// // 6 Jupiter -/// // 5 Saturn /// }); /// ``` /// To check whether the map has an entry with a specific key, use [containsKey]. From 8def903bcc4ef33155e27ffc6599c709a17a5922 Mon Sep 17 00:00:00 2001 From: Tirth Date: Fri, 31 Jan 2025 15:00:35 +0530 Subject: [PATCH 4/4] Update hash_map.dart --- sdk/lib/collection/hash_map.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/lib/collection/hash_map.dart b/sdk/lib/collection/hash_map.dart index de8945169d7c..c5895ac11a82 100644 --- a/sdk/lib/collection/hash_map.dart +++ b/sdk/lib/collection/hash_map.dart @@ -83,9 +83,9 @@ typedef _Hasher = int Function(K object); /// ``` /// To remove an entry with a specific key, use [remove]. /// ```dart continued -/// final removeValue = planets.remove(5); -/// print(removeValue); // Saturn -/// print(planets); // fx {3: Earth, 4: Mars, 6: Jupiter} +/// final removeValue = planets.remove(6); +/// print(removeValue); // Jupiter +/// print(planets); // fx {4: Mars, 3: Earth, 5: Saturn} /// ``` /// To remove multiple entries at the same time, based on their keys and values, /// use [removeWhere].