Reword comments to remove explicit TODO

Keeping the comments in some degree is valuable, as it clarifies the
time complexity of the operations done; in the event of a performance
issue, this would likely be somewhere to look. However, remove the
`TODO` string directly, as it is not an urgent look-at-me-now.
This commit is contained in:
Rick Henry 2021-12-20 18:47:48 +00:00 committed by Rick Henry
parent 6fc68a82db
commit ab8817eb9c
No known key found for this signature in database
GPG Key ID: 07243CA36106218D

View File

@ -186,9 +186,10 @@ func (p *SafeDNSProvider) ApplyChanges(ctx context.Context, changes *plan.Change
}
}
for _, endpoint := range changes.UpdateNew {
// TODO: Find a more effient way of doing this.
// Currently iterates over each zoneRecord in ZoneRecords for each Endpoint in UpdateNew; the same will go for
// Delete. As it's double-iteration, that's O(n^2), which isn't great.
// Currently iterates over each zoneRecord in ZoneRecords for each Endpoint
// in UpdateNew; the same will go for Delete. As it's double-iteration,
// that's O(n^2), which isn't great. No performance issues have been noted
// thus far.
var zoneRecord ZoneRecord
for _, target := range endpoint.Targets {
for _, zr := range zoneRecords {
@ -219,7 +220,7 @@ func (p *SafeDNSProvider) ApplyChanges(ctx context.Context, changes *plan.Change
}
}
for _, endpoint := range changes.Delete {
// TODO: Find a more effient way of doing this.
// As above, currently iterates in O(n^2). May be a good start for optimisations.
var zoneRecord ZoneRecord
for _, zr := range zoneRecords {
if zr.Name == endpoint.DNSName && string(zr.Type) == endpoint.RecordType {