Open
Description
See
// ASCII, a single percent encoded sequence.
codeUnits = new List(3);
codeUnits[0] = _PERCENT;
codeUnits[1] = _hexDigits.codeUnitAt(char >> 4);
codeUnits[2] = _hexDigits.codeUnitAt(char & 0xf);
Also in the SDK,
2x in this file https://github.com/dart-lang/sdk/blob/031e77eea11a16a5e486a3673549adbd68862c8e/sdk/lib/vmservice/message.dart#L176-L182
4x in this file https://github.com/dart-lang/sdk/blob/031e77eea11a16a5e486a3673549adbd68862c8e/runtime/bin/vmservice/loader.dart#L1107-L1112
This entire file in pkg:isolate
- https://github.com/dart-lang/isolate/blob/master/lib/src/util.dart
In the Dart sources in Google (some of these duplicate the above)
List.unmodifiable\(\[
- 135 hitsList\<.+\>\.unmodifiable\(\[
- 96 timesMap\<.+,.+>\.unmodifiable\(\{
- 25 timesMap\.unmodifiable\(\{
- 28 timesUnmodifiableSetView
frompkg:collection
is used dozens of times, not as a view over mutable data, but as a immutable set.
Benefits:
- Less copying!
- Immutable collections are more efficient
- iteration doesn't need to track
version
, etc - no need to have indirection to a fixed-sized backing store to support growing
- iteration doesn't need to track
- Enables special-casing implementations - e.g.
immutable([1,2,3])
could be created asUint8List
.