Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Dec 16, 2024
1 parent a20f3b7 commit 274212e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ jobs:
BUILDCACHE_DIRECT_MODE: true
BUILDCACHE_MAX_CACHE_SIZE: 26843545600
BUILDCACHE_LUA_PATH: ${{ github.workspace }}/tools
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1
ASAN_OPTIONS: alloc_dealloc_mismatch=0
steps:
- uses: actions/checkout@v4

Expand Down
10 changes: 5 additions & 5 deletions src/match_platforms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,20 @@ double get_match_bonus(Collection&& names,
auto bonus = 0U;
auto const size = static_cast<double>(name.size());
if (has_exact_match(names, ref)) {
bonus += 200.0 - size;
bonus += std::max(0.0, 200.0 - size);
}
if (has_number_match(names, name)) {
bonus += 140.0 - size;
bonus += std::max(0.0, 140.0 - size);
}
if (auto const track = get_track(ref);
track.has_value() && has_number_match(names, *track)) {
bonus += 60.0 - size;
bonus += std::max(0.0, 60.0 - size);
}
if (has_exact_match(names, name)) {
bonus += 15.0 - size;
bonus += std::max(0.0, 15.0 - size);
}
if (has_contains_match(names, ref)) {
bonus += 5.0 - size;
bonus += std::max(0.0, 5.0 - size);
}
return bonus;
}
Expand Down

0 comments on commit 274212e

Please sign in to comment.