From c19253215bd5f191f2a2bfe55915f5f74052805f Mon Sep 17 00:00:00 2001 From: James Rasell Date: Thu, 22 Jun 2023 08:46:28 +0200 Subject: [PATCH] core: use faster concatenation for alloc name generation. (#17591) --- nomad/structs/funcs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nomad/structs/funcs.go b/nomad/structs/funcs.go index 77e1902d0..212453aa3 100644 --- a/nomad/structs/funcs.go +++ b/nomad/structs/funcs.go @@ -382,7 +382,7 @@ func DenormalizeAllocationJobs(job *Job, allocs []*Allocation) { // AllocName returns the name of the allocation given the input. func AllocName(job, group string, idx uint) string { - return fmt.Sprintf("%s.%s[%d]", job, group, idx) + return job + "." + group + "[" + strconv.FormatUint(uint64(idx), 10) + "]" } // AllocSuffix returns the alloc index suffix that was added by the AllocName