From 1a6421120a48d84ea8f77d9eac01320fc91a56fb Mon Sep 17 00:00:00 2001 From: Mathias Lang Date: Thu, 18 Jan 2024 04:02:22 +0100 Subject: [PATCH] Trivial: Align PackageManager's lookup signatures --- source/dub/packagemanager.d | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/dub/packagemanager.d b/source/dub/packagemanager.d index f7bb9a40f..75914f3e1 100644 --- a/source/dub/packagemanager.d +++ b/source/dub/packagemanager.d @@ -188,7 +188,7 @@ class PackageManager { * Returns: * A `Package` if one was found, `null` if none exists. */ - protected Package lookup (PackageName name, Version vers) { + protected Package lookup (in PackageName name, in Version vers) { if (!this.m_initialized) this.refresh(); @@ -1403,14 +1403,15 @@ package struct Location { * Returns: * A `Package` if one was found, `null` if none exists. */ - inout(Package) lookup(string name, Version ver) inout { + inout(Package) lookup(in PackageName name, in Version ver) inout { foreach (pkg; this.localPackages) - if (pkg.name == name && pkg.version_.matches(ver, VersionMatchMode.standard)) + if (pkg.name == name.toString() && + pkg.version_.matches(ver, VersionMatchMode.standard)) return pkg; foreach (pkg; this.fromPath) { auto pvm = this.isManaged(pkg.basePackage.path) ? VersionMatchMode.strict : VersionMatchMode.standard; - if (pkg.name == name && pkg.version_.matches(ver, pvm)) + if (pkg.name == name.toString() && pkg.version_.matches(ver, pvm)) return pkg; } return null;