From eeec1fe372266c228b715b19c65073208883f28e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Feb 2026 16:32:47 +0000 Subject: [PATCH] chore: use slices.Sorted(maps.Keys()) for ordered iteration Co-Authored-By: Claude Opus 4.6 --- internal/metal/lora.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/metal/lora.go b/internal/metal/lora.go index aab49c4..2bcb661 100644 --- a/internal/metal/lora.go +++ b/internal/metal/lora.go @@ -12,6 +12,7 @@ import ( "encoding/json" "fmt" "log/slog" + "maps" "math" "os" "path/filepath" @@ -152,12 +153,7 @@ func (a *LoRAAdapter) TotalParams() int { // SortedNames returns layer names in deterministic sorted order. func (a *LoRAAdapter) SortedNames() []string { - names := make([]string, 0, len(a.Layers)) - for name := range a.Layers { - names = append(names, name) - } - slices.Sort(names) - return names + return slices.Sorted(maps.Keys(a.Layers)) } // AllTrainableParams returns all trainable arrays (A and B from every layer),