Skip to content

Commit

Permalink
Replace usages of in ref with const ref
Browse files Browse the repository at this point in the history
To accomodate for the latest round of deprecations.
  • Loading branch information
Geod24 committed Jun 25, 2023
1 parent 21c6b4f commit 230d8a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/dubregistry/registry.d
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ class DubRegistry {
return name;
}

protected bool addVersion(in ref DbPackage dbpack, string ver, Repository rep, RefInfo reference)
protected bool addVersion(const ref DbPackage dbpack, string ver, Repository rep, RefInfo reference)
{
logDiagnostic("Adding new version info %s for %s", ver, dbpack.name);
assert(ver.startsWith("~") && !ver.startsWith("~~") || isValidVersion(ver));
Expand Down Expand Up @@ -763,7 +763,7 @@ enum PackageInfoFlags
}

/// Computes a package score from given package stats and global distributions of those stats.
private float computeScore(DownDist, RepoDist)(in ref DbPackageStats stats, DownDist downDist, RepoDist repoDist)
private float computeScore(DownDist, RepoDist)(const ref DbPackageStats stats, DownDist downDist, RepoDist repoDist)
@safe {
import std.algorithm.comparison : max;
import std.math : log1p, round, tanh;
Expand Down
4 changes: 2 additions & 2 deletions source/dubregistry/web.d
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ class DubRegistryWebFrontend {
auto pcount = packages.length;

// sort by date of last version
SysTime getDate(in ref CachedPackageSlot p) {
SysTime getDate(const ref CachedPackageSlot p) {
if (p.versions.length == 0) return SysTime(0, UTC());
return p.versions[$-1].date;
}
bool compare(in ref CachedPackageSlot a, in ref CachedPackageSlot b) {
bool compare(const ref CachedPackageSlot a, const ref CachedPackageSlot b) {
bool a_has_ver = a.versions.any!(v => !v.version_.startsWith("~"));
bool b_has_ver = b.versions.any!(v => !v.version_.startsWith("~"));
if (a_has_ver != b_has_ver) return a_has_ver;
Expand Down

0 comments on commit 230d8a2

Please sign in to comment.