The existing code would copy the name of the definition out to callers. This caused allocation and other unnecessary things to occur to determine which definition of a secret was found.
Add a new interop method to get the count of definitions in the scanner. Add a new interop method to get the name of the definition by index. Update C# to use these new interop methods to cache the definition names once, then always use the definition ID to get to an interned string for the definition.
The existing code would copy the name of the definition out to callers. This caused allocation and other unnecessary things to occur to determine which definition of a secret was found.
Add a new interop method to get the count of definitions in the scanner. Add a new interop method to get the name of the definition by index. Update C# to use these new interop methods to cache the definition names once, then always use the definition ID to get to an interned string for the definition.