mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 02:27:39 +00:00
Remove unused AnalysisContextImpl.findElementById().
R=brianwilkerson@google.com BUG= Review URL: https://codereview.chromium.org//1132623002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45618 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
61a371476b
commit
47df8674d1
|
@ -674,29 +674,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
return source.exists();
|
||||
}
|
||||
|
||||
Element findElementById(int id) {
|
||||
// TODO(brianwilkerson) Implement this.
|
||||
return null;
|
||||
// _ElementByIdFinder finder = new _ElementByIdFinder(id);
|
||||
// try {
|
||||
// MapIterator<AnalysisTarget, cache.CacheEntry> iterator =
|
||||
// _cache.iterator();
|
||||
// while (iterator.moveNext()) {
|
||||
// cache.CacheEntry entry = iterator.value;
|
||||
// if (entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) {
|
||||
// DartEntry dartEntry = entry;
|
||||
// LibraryElement library = dartEntry.getValue(DartEntry.ELEMENT);
|
||||
// if (library != null) {
|
||||
// library.accept(finder);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } on _ElementByIdFinderException {
|
||||
// return finder.result;
|
||||
// }
|
||||
// return null;
|
||||
}
|
||||
|
||||
@override
|
||||
cache.CacheEntry getCacheEntry(AnalysisTarget target) {
|
||||
cache.CacheEntry entry = _cache.get(target);
|
||||
|
|
|
@ -1796,26 +1796,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
return source.exists();
|
||||
}
|
||||
|
||||
Element findElementById(int id) {
|
||||
_ElementByIdFinder finder = new _ElementByIdFinder(id);
|
||||
try {
|
||||
MapIterator<Source, SourceEntry> iterator = _cache.iterator();
|
||||
while (iterator.moveNext()) {
|
||||
SourceEntry sourceEntry = iterator.value;
|
||||
if (sourceEntry.kind == SourceKind.LIBRARY) {
|
||||
DartEntry dartEntry = sourceEntry;
|
||||
LibraryElement library = dartEntry.getValue(DartEntry.ELEMENT);
|
||||
if (library != null) {
|
||||
library.accept(finder);
|
||||
}
|
||||
}
|
||||
}
|
||||
} on _ElementByIdFinderException {
|
||||
return finder.result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
cache.CacheEntry getCacheEntry(AnalysisTarget target) {
|
||||
return null;
|
||||
|
@ -11687,21 +11667,3 @@ class _AnalysisFutureHelper<T> {
|
|||
return pendingFuture.future;
|
||||
}
|
||||
}
|
||||
|
||||
class _ElementByIdFinder extends GeneralizingElementVisitor {
|
||||
final int _id;
|
||||
Element result;
|
||||
|
||||
_ElementByIdFinder(this._id);
|
||||
|
||||
@override
|
||||
visitElement(Element element) {
|
||||
if (element.id == _id) {
|
||||
result = element;
|
||||
throw new _ElementByIdFinderException();
|
||||
}
|
||||
super.visitElement(element);
|
||||
}
|
||||
}
|
||||
|
||||
class _ElementByIdFinderException {}
|
||||
|
|
Loading…
Reference in a new issue