Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ftl committed Oct 2, 2023
1 parent 7c3cc8d commit d6239ba
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
2 changes: 0 additions & 2 deletions core/bandmap/bandmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,6 @@ func (l *Entries) cleanOutFalseEntries() {
switch CheckFalseEntry(entry1.BandmapEntry, entry2.BandmapEntry) {
case DifferentEntries:
continue
case EqualEntries:
// TODO: merge entry2 into entry1
case FirstIsFalse:
removedEntries = append(removedEntries, *entry1)
l.entries[i] = nil
Expand Down
5 changes: 1 addition & 4 deletions core/bandmap/false_entry_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type FalseEntryCheckResult int

const (
DifferentEntries FalseEntryCheckResult = iota
EqualEntries
FirstIsFalse
SecondIsFalse
)
Expand All @@ -33,9 +32,7 @@ func CheckFalseEntry(entry1, entry2 core.BandmapEntry) FalseEntryCheckResult {
case !callsignSimilar:
return DifferentEntries
case !frequencySimilar:
return DifferentEntries // TODO if one entry is much older than the other, the older one is false
case callsignEqual:
return EqualEntries
return DifferentEntries
case callsignSimilar && firstHasFalseSpotCount:
return FirstIsFalse
case callsignSimilar && secondHasFalseSpotCount:
Expand Down
26 changes: 0 additions & 26 deletions core/bandmap/false_entry_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,6 @@ func Test(t *testing.T) {
},
expected: DifferentEntries,
},
{
desc: "equal callsign, equal frequency",
entry1: core.BandmapEntry{
Call: callsign.MustParse("DL0ABC"),
SpotCount: 100,
},
entry2: core.BandmapEntry{
Call: callsign.MustParse("DL0ABC"),
SpotCount: 1,
},
expected: EqualEntries,
},
{
desc: "equal callsign, similar frequency",
entry1: core.BandmapEntry{
Call: callsign.MustParse("DL0ABC"),
Frequency: 7000000,
SpotCount: 100,
},
entry2: core.BandmapEntry{
Call: callsign.MustParse("DL0ABC"),
Frequency: 7000050,
SpotCount: 1,
},
expected: EqualEntries,
},
{
desc: "similar callsign, same frequency, second more spots than first",
entry1: core.BandmapEntry{
Expand Down

0 comments on commit d6239ba

Please sign in to comment.