Is there an existing issue for this?
Task description
When looking through the codebase, I noticed a few places where we are doing:
field.PutAttribute(legacyKey, LegacyDocValuesType.BYTES_FIXED_DEREF.ToString());
The BYTES_FIXED_DEREF is a compile-time enum value, so it would both be more readable, and save an initial allocation if we changed it to:
field.PutAttribute(legacyKey, nameof(LegacyDocValuesType.BYTES_FIXED_DEREF));
I had ChatGPT sketch up the code for what this analyzer and code fix would look like:
https://chatgpt.com/share/69f41082-6ccc-8323-8639-9d4b6ff906f3
Note that this won't work on runtime values of variables that are declared LegacyDocValuesType, it is only sensible to do this when referencing the enum value directly as in the above example.
Is there an existing issue for this?
Task description
When looking through the codebase, I noticed a few places where we are doing:
The
BYTES_FIXED_DEREFis a compile-time enum value, so it would both be more readable, and save an initial allocation if we changed it to:I had ChatGPT sketch up the code for what this analyzer and code fix would look like:
https://chatgpt.com/share/69f41082-6ccc-8323-8639-9d4b6ff906f3
Note that this won't work on runtime values of variables that are declared
LegacyDocValuesType, it is only sensible to do this when referencing the enum value directly as in the above example.