Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code: PackageIndex.containsPackage #2359

Merged
merged 1 commit into from Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 0 additions & 14 deletions app/lib/search/index_simple.dart
Expand Up @@ -72,20 +72,6 @@ class SimplePackageIndex implements PackageIndex {
return data;
}

@override
Future<bool> containsPackage(String package,
{String version, Duration maxAge}) async {
final PackageDocument doc = _packages[package];
if (doc == null) return false;
if (version != null && doc.version != version) return false;
if (maxAge != null &&
(doc.timestamp == null ||
DateTime.now().toUtc().difference(doc.timestamp) > maxAge)) {
return false;
}
return true;
}

@override
Future addPackage(PackageDocument document) async {
final PackageDocument doc = document.intern(_internPool.intern);
Expand Down
2 changes: 0 additions & 2 deletions app/lib/shared/search_service.dart
Expand Up @@ -23,8 +23,6 @@ const int maxPages = 10;
/// Package search index and lookup.
abstract class PackageIndex {
bool get isReady;
Future<bool> containsPackage(String package,
{String version, Duration maxAge});
Future addPackage(PackageDocument doc);
Future addPackages(Iterable<PackageDocument> documents);
Future removePackage(String package);
Expand Down