SIGN IN SIGN UP

debug/elf: avoid needless inner loops in dynamicVersions

If vnext is 0, the loop would in the worst case needlessly loop for up
to 65536 times (cnt is an uint16 value) reading the same item from d
over and over.  Break out of the loop in that case, similar to the outer
loop and the one in dynamicVersionNeeds.

Change-Id: I4292599e4b427b03a80212551f9769f4070da5ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/784240
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
T
Tobias Klauser committed
37699df177e1468da78b4067a3bda367ea70aa51
Parent: 1fb0cc0
Committed by Gopher Robot <gobot@golang.org> on 6/1/2026, 8:35:28 PM