refactor: clean up verbose and redundant comments
Trim or remove comments that: - State the obvious (function names already convey purpose) - Repeat what the code clearly shows - Are excessively long without adding value Keep comments that explain *why*, not *what*.
This commit is contained in:
parent
805e7ffdc2
commit
5b942a5fd6
11 changed files with 16 additions and 102 deletions
|
|
@ -95,9 +95,6 @@ func (p *Planner) Plan(req contracts.SearchRequest) (localEngines, upstreamEngin
|
|||
}
|
||||
|
||||
func inferFromCategories(categories []string) []string {
|
||||
// Minimal mapping for the initial porting subset.
|
||||
// This mirrors the idea of selecting from engine categories without
|
||||
// embedding the whole engine registry.
|
||||
set := map[string]bool{}
|
||||
for _, c := range categories {
|
||||
switch strings.TrimSpace(strings.ToLower(c)) {
|
||||
|
|
@ -131,7 +128,6 @@ func inferFromCategories(categories []string) []string {
|
|||
}
|
||||
|
||||
func sortByOrder(list []string, order map[string]int) {
|
||||
// simple insertion sort (list is tiny)
|
||||
for i := 1; i < len(list); i++ {
|
||||
j := i
|
||||
for j > 0 && order[list[j-1]] > order[list[j]] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue