Skip to content

Commit

Permalink
Trivial: Align PackageManager's lookup signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Geod24 committed Jan 18, 2024
1 parent 3bd3b5d commit f615e30
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/dub/packagemanager.d
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f615e30

Please sign in to comment.