)]}'
{
  "commit": "8d3b6ce54ccb09dd970cd45fc3cded4a35beac31",
  "tree": "c2c51402da8f3af22f8e4018b92bb7e0ad265f4e",
  "parents": [
    "882e883be2fa3fca0cf75fd3dc011237d91663ed"
  ],
  "author": {
    "name": "Konstantin Shcheglov",
    "email": "scheglov@google.com",
    "time": "Mon Jan 08 18:55:48 2024 +0000"
  },
  "committer": {
    "name": "Commit Queue",
    "email": "dart-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Mon Jan 08 18:55:48 2024 +0000"
  },
  "message": "Use flattenedToList/flattenedToSet instead of generic expand().\n\nIt is faster.\n\n[expand: 102]\n[flattened: 131]\n[flattened2: 37]\n\nimport \u0027package:collection/collection.dart\u0027;\n\nmain() {\n  const outerLength \u003d 100;\n  const innerLength \u003d 10;\n  final listOfLists \u003d List.generate(outerLength, (i) {\n    return List.generate(innerLength, (j) \u003d\u003e i * innerLength + j);\n  });\n\n  for (var i \u003d 0; i \u003c 10; i++) {\n    f(listOfLists);\n  }\n}\n\nvoid f(List\u003cList\u003cint\u003e\u003e listOfLists) {\n  const repeatCount \u003d 10000;\n\n  {\n    final timer \u003d Stopwatch()..start();\n    for (var i \u003d 0; i \u003c repeatCount; i++) {\n      listOfLists.expand((e) \u003d\u003e e).toList();\n    }\n    print(\u0027[expand: ${timer.elapsedMilliseconds}]\u0027);\n  }\n\n  {\n    final timer \u003d Stopwatch()..start();\n    for (var i \u003d 0; i \u003c repeatCount; i++) {\n      listOfLists.flattened.toList();\n    }\n    print(\u0027[flattened: ${timer.elapsedMilliseconds}]\u0027);\n  }\n\n  {\n    final timer \u003d Stopwatch()..start();\n    for (var i \u003d 0; i \u003c repeatCount; i++) {\n      listOfLists.flattened2.toList();\n    }\n    print(\u0027[flattened2: ${timer.elapsedMilliseconds}]\u0027);\n  }\n}\n\nextension ListListExtensions\u003cT\u003e on List\u003cList\u003cT\u003e\u003e {\n  Iterable\u003cT\u003e get flattened2 {\n    return [\n      for (final elements in this) ...elements,\n    ];\n  }\n}\n\nChange-Id: I0bf9dc0c8735fe62aab69cbce276254e2db110f9\nReviewed-on: https://dart-review.googlesource.com/c/sdk/+/345202\nReviewed-by: Jacob Richman \u003cjacobr@google.com\u003e\nReviewed-by: Brian Wilkerson \u003cbrianwilkerson@google.com\u003e\nReviewed-by: Phil Quitslund \u003cpquitslund@google.com\u003e\nCommit-Queue: Konstantin Shcheglov \u003cscheglov@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "304960250602bd95fd9e2be03db2155d50181458",
      "old_mode": 33188,
      "old_path": "pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart",
      "new_id": "ca3f9fd28426c2baedf2f8983b87dd77cba85712",
      "new_mode": 33188,
      "new_path": "pkg/analysis_server/lib/src/lsp/handlers/code_actions/plugins.dart"
    },
    {
      "type": "modify",
      "old_id": "e2d78b4d3b9cd49460188753b7b0ec1fd1dd4740",
      "old_mode": 33188,
      "old_path": "pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart",
      "new_id": "e2f0acd1bbfe1125e6acd2a1920749a5e43771f1",
      "new_mode": 33188,
      "new_path": "pkg/analysis_server/lib/src/lsp/handlers/handler_semantic_tokens.dart"
    },
    {
      "type": "modify",
      "old_id": "c6ff9e96cd23f5b7bb9c1ce44cfe53d74d7b2821",
      "old_mode": 33188,
      "old_path": "pkg/analysis_server/lib/src/lsp/mapping.dart",
      "new_id": "74670340b42036f429053e3c183c61b7eed8fe1d",
      "new_mode": 33188,
      "new_path": "pkg/analysis_server/lib/src/lsp/mapping.dart"
    },
    {
      "type": "modify",
      "old_id": "a79a488da7c6ff11aefe71d42d35e43f50a7ff21",
      "old_mode": 33188,
      "old_path": "pkg/analysis_server/lib/src/lsp/semantic_tokens/legend.dart",
      "new_id": "366015c5df3d74e6d74883e72e998f9c4688164e",
      "new_mode": 33188,
      "new_path": "pkg/analysis_server/lib/src/lsp/semantic_tokens/legend.dart"
    },
    {
      "type": "modify",
      "old_id": "c81de49a4fbab70a6560d7d1adc5afc42aba2a55",
      "old_mode": 33188,
      "old_path": "pkg/analysis_server/lib/src/operation/operation_analysis.dart",
      "new_id": "10cffda5d5aa34d9f01fd9d8bd46d44ec872cd5e",
      "new_mode": 33188,
      "new_path": "pkg/analysis_server/lib/src/operation/operation_analysis.dart"
    },
    {
      "type": "modify",
      "old_id": "d910bcbe73018d071398e617638ce8459283a9c1",
      "old_mode": 33188,
      "old_path": "pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart",
      "new_id": "8dfa0f36ff8bde43ca9ec035df31f14de4493be9",
      "new_mode": 33188,
      "new_path": "pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart"
    },
    {
      "type": "modify",
      "old_id": "3e4e47909fda7fae51cc2c002629ff054c6380ff",
      "old_mode": 33188,
      "old_path": "pkg/analysis_server/lib/src/utilities/import_analyzer.dart",
      "new_id": "90ecb647af137359f45d77279fd2b212b34d6d49",
      "new_mode": 33188,
      "new_path": "pkg/analysis_server/lib/src/utilities/import_analyzer.dart"
    },
    {
      "type": "modify",
      "old_id": "b65a669e983813f059b817a13e9024d1f0a091fd",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/analysis/driver.dart",
      "new_id": "d8634656a0f832dbc216672a8493ed61ccd2414c",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/analysis/driver.dart"
    },
    {
      "type": "modify",
      "old_id": "d74630d581f4b0cf740004cb8fdaed7e62b8ac58",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/analysis/library_graph.dart",
      "new_id": "c1113f8fc68d1f4b175241f41813a4b053bdb54f",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/analysis/library_graph.dart"
    },
    {
      "type": "modify",
      "old_id": "a767bb3aa57dc322f2eee1c7c140297e3dd70eb6",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/element/generic_inferrer.dart",
      "new_id": "8801ec5eea06f078c81dc055e01eec805d88208a",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/element/generic_inferrer.dart"
    },
    {
      "type": "modify",
      "old_id": "fb28e84050280ee6f62b618ba9d7bfd31b0760ab",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/fasta/ast_builder.dart",
      "new_id": "d4c6a342dd5e2870795d5cf793eff388885142da",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/fasta/ast_builder.dart"
    },
    {
      "type": "modify",
      "old_id": "c7559b49f90924e82bfcf0c714f9766e5c07c0d2",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/summary2/library_builder.dart",
      "new_id": "61d5563c06794ccedcfaef4164e03d8331a59684",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/summary2/library_builder.dart"
    },
    {
      "type": "modify",
      "old_id": "14362d64a8bdc7013dcde677992fb4855f96a77c",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/utilities/extensions/collection.dart",
      "new_id": "0ba8e0c0a470cb6a25c713121c0b99a17501549e",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/utilities/extensions/collection.dart"
    },
    {
      "type": "modify",
      "old_id": "35953aa1dac0e69879f8249c8c8fd3b55762264f",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart",
      "new_id": "d6f7cc4d95847f9e93d73b8a6703d0d315dd6e16",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart"
    },
    {
      "type": "modify",
      "old_id": "b8b8520156f43393de732455834dd3e8eaefcad3",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/test/src/utilities/extensions/collection_test.dart",
      "new_id": "9d824a36454a6197bac48043218b50e20f73b8b2",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/test/src/utilities/extensions/collection_test.dart"
    }
  ]
}
