Module cycle detection code currently deduplicates any imported modules. See issue 16208 for an explanation.
However, this was recently fixed (see issue 20037). I can probably avoid allocation of the edges arrays and just use the already-existing moduleinfo data to do cycle detection to streamline the code.
Comment #1 by robert.schadek — 2024-12-07T13:39:35Z