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

Side by Side Diff: pkg/analyzer/lib/file_system/physical_file_system.dart

Issue 952333002: Don't do folder existence checks when parsing pub list results. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library physical_file_system; 5 library physical_file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 9
10 import 'package:analyzer/src/generated/java_io.dart'; 10 import 'package:analyzer/src/generated/java_io.dart';
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return isWithin(this.path, path); 123 return isWithin(this.path, path);
124 } 124 }
125 125
126 @override 126 @override
127 Resource getChild(String relPath) { 127 Resource getChild(String relPath) {
128 String canonicalPath = canonicalizePath(relPath); 128 String canonicalPath = canonicalizePath(relPath);
129 return PhysicalResourceProvider.INSTANCE.getResource(canonicalPath); 129 return PhysicalResourceProvider.INSTANCE.getResource(canonicalPath);
130 } 130 }
131 131
132 @override 132 @override
133 _PhysicalFolder getChildAssumingFolder(String relPath) {
134 String canonicalPath = canonicalizePath(relPath);
135 io.Directory directory = new io.Directory(canonicalPath);
136 return new _PhysicalFolder(directory);
137 }
138
139 @override
133 List<Resource> getChildren() { 140 List<Resource> getChildren() {
134 List<Resource> children = <Resource>[]; 141 List<Resource> children = <Resource>[];
135 io.Directory directory = _entry as io.Directory; 142 io.Directory directory = _entry as io.Directory;
136 List<io.FileSystemEntity> entries = directory.listSync(recursive: false); 143 List<io.FileSystemEntity> entries = directory.listSync(recursive: false);
137 int numEntries = entries.length; 144 int numEntries = entries.length;
138 for (int i = 0; i < numEntries; i++) { 145 for (int i = 0; i < numEntries; i++) {
139 io.FileSystemEntity entity = entries[i]; 146 io.FileSystemEntity entity = entries[i];
140 if (entity is io.Directory) { 147 if (entity is io.Directory) {
141 children.add(new _PhysicalFolder(entity)); 148 children.add(new _PhysicalFolder(entity));
142 } else if (entity is io.File) { 149 } else if (entity is io.File) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 bool operator ==(other) { 196 bool operator ==(other) {
190 if (runtimeType != other.runtimeType) { 197 if (runtimeType != other.runtimeType) {
191 return false; 198 return false;
192 } 199 }
193 return path == other.path; 200 return path == other.path;
194 } 201 }
195 202
196 @override 203 @override
197 String toString() => path; 204 String toString() => path;
198 } 205 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/lib/source/pub_package_map_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698