Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: sdk/lib/io/platform_impl.dart

Issue 214723002: Remove unmodifiable map wrappers that could instead use UnmodifiableMapView. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix missing import, increment mirror function count. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/io.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 class _Platform { 7 class _Platform {
8 external static int _numberOfProcessors(); 8 external static int _numberOfProcessors();
9 external static String _pathSeparator(); 9 external static String _pathSeparator();
10 external static String _operatingSystem(); 10 external static String _operatingSystem();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // handle these correctly we search for a second occurrence of 64 // handle these correctly we search for a second occurrence of
65 // of '=' in the string if the first occurrence is at index 0. 65 // of '=' in the string if the first occurrence is at index 0.
66 var equalsIndex = str.indexOf('='); 66 var equalsIndex = str.indexOf('=');
67 if (equalsIndex == 0) { 67 if (equalsIndex == 0) {
68 equalsIndex = str.indexOf('=', 1); 68 equalsIndex = str.indexOf('=', 1);
69 } 69 }
70 assert(equalsIndex != -1); 70 assert(equalsIndex != -1);
71 result[str.substring(0, equalsIndex)] = 71 result[str.substring(0, equalsIndex)] =
72 str.substring(equalsIndex + 1); 72 str.substring(equalsIndex + 1);
73 } 73 }
74 _environmentCache = new _UnmodifiableMap(result); 74 _environmentCache = new UnmodifiableMapView(result);
75 } else { 75 } else {
76 _environmentCache = env; 76 _environmentCache = env;
77 } 77 }
78 } 78 }
79 79
80 if (_environmentCache is OSError) { 80 if (_environmentCache is OSError) {
81 throw _environmentCache; 81 throw _environmentCache;
82 } else { 82 } else {
83 return _environmentCache; 83 return _environmentCache;
84 } 84 }
(...skipping 30 matching lines...) Expand all
115 } 115 }
116 V remove(String key) => _map.remove(key.toUpperCase()); 116 V remove(String key) => _map.remove(key.toUpperCase());
117 void clear() => _map.clear(); 117 void clear() => _map.clear();
118 void forEach(void f(String key, V value)) => _map.forEach(f); 118 void forEach(void f(String key, V value)) => _map.forEach(f);
119 Iterable<String> get keys => _map.keys; 119 Iterable<String> get keys => _map.keys;
120 Iterable<V> get values => _map.values; 120 Iterable<V> get values => _map.values;
121 int get length => _map.length; 121 int get length => _map.length;
122 bool get isEmpty => _map.isEmpty; 122 bool get isEmpty => _map.isEmpty;
123 bool get isNotEmpty => _map.isNotEmpty; 123 bool get isNotEmpty => _map.isNotEmpty;
124 } 124 }
OLDNEW
« no previous file with comments | « sdk/lib/io/io.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698