aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/net.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-15 22:05:24 +0900
committerOphestra <cat@gensokyo.uk>2026-01-15 23:30:43 +0900
commit3499a82785f8cb82bfe528875391d76d5e03c3de (patch)
tree66d82b1a95fc3137cfb7a2ffa82af0d84b613aa0 /internal/pkg/net.go
parent088d35e4e65f1a22d32ac66d223672ed923fa328 (diff)
internal/pkg: cache computed identifiers
This eliminates duplicate identifier computations. The new implementation also significantly reduces allocations while computing identifier for a large dependency tree. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/net.go')
-rw-r--r--internal/pkg/net.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/pkg/net.go b/internal/pkg/net.go
index b8d85b91..c481b52e 100644
--- a/internal/pkg/net.go
+++ b/internal/pkg/net.go
@@ -50,9 +50,11 @@ func NewHTTPGet(
// Kind returns the hardcoded [Kind] constant.
func (a *httpArtifact) Kind() Kind { return KindHTTPGet }
-// Params returns the backing url string. Context is not represented as it does
+// Params writes the backing url string. Client is not represented as it does
// not affect [Cache.Cure] outcome.
-func (a *httpArtifact) Params() []byte { return []byte(a.url) }
+func (a *httpArtifact) Params(ctx *IContext) {
+ ctx.GetHash().Write([]byte(a.url))
+}
// Dependencies returns a nil slice.
func (a *httpArtifact) Dependencies() []Artifact { return nil }