Q:

Is there any point of refactoring LUT array to case statement?

I've got the following LUT (lookup table) for retrieval of display name for pseudo-PChar (all these predefined PChars are integers under their skin, you know) input:
const
  RT_MIN = DWORD(RT_CURSOR);
  RT_MAX = DWORD(RT_MANIFEST);

  ResourceTypes: array [RT_MIN..RT_MAX] of PChar = (
    'Hardware-dependent cursor',
    'Bitmap',
    'Hardware-dependent icon',
    'Menu',
    'Dialog box',
    'String-table entry',
    'Font directory',
    'Font',
    'Accelerator table',
    'Application-defined resource (raw data)',
    'Message-table entry',
    'Hardware-independent cursor',
    nil, { unknown, reserved or not used }
    'Hardware-independent icon',
    nil, { unknown, reserved or not used }
    'Version',
    'Dialog Include',
    nil, { unknown, reserved or not used }
    'Plug and Play',
    'VxD',
    'Animated cursor',
    'Animated icon',
    'HTML resource',
    'Side-by-Side Assembly Manifest'
  );

Will I get any advantages/disadvantages in rewriting that as case statement? Are there any advantages/disadvantages in leaving that as is?

A:

I think that using an array is the fastest method. If you e.g. query ResourceTypes[2], the program will first look at ResourceTypes[2], dereference the PChar and output the zero terminated string. If the compiler is smart, it could recognize that the strings are unchangeable and so it could place all strings directly in the array, so you would save one dereferencing operation. (For those who are interested in it, can view the memory contents using an hex-editor like HxD to check if this is true or not).
Another problem which might happen in future could be following scenario: Let's say Microsoft defines a new resource type which is something very special, and so it gets a large number like $FFFF . If you are using case of, you can simply add 2 lines of code to add this new resource type. By having a lookup-table (or LUT, this abbreviation is new to me), you would have a problem then, since you would need to create an array with size 65535 whose contents are to 99% just nils.
I would accomplish it by creating a function:
function GetHumanFriendlyResourceTypeName(AResourceType: PChar): string;
begin
  if not Is_IntResource(AResourceType) then
  begin
    result := AResourceType;
  end
  else
  begin
    case Integer(AResourceType) of
      Integer(RT_CURSOR):
        result := 'Hardware-dependent cursor';
      Integer(RT_BITMAP):
        result := 'Bitmap';
      Integer(RT_ICON):
        result := 'Hardware-dependent icon';
      Integer(RT_MENU):
        result := 'Menu';
      Integer(RT_DIALOG):
        result := 'Dialog box';
      Integer(RT_STRING):
        result := 'String-table entry';
      Integer(RT_FONTDIR):
        result := 'Font directory';
      Integer(RT_FONT):
        result := 'Font';
      Integer(RT_ACCELERATOR):
        result := 'Accelerator table';
      Integer(RT_RCDATA):
        result := 'Application-defined resource (raw data)';
      Integer(RT_MESSAGETABLE):
        result := 'Message-table entry';
      Integer(RT_GROUP_CURSOR):
        result := 'Hardware-independent cursor';
      Integer(RT_GROUP_ICON):
        result := 'Hardware-independent icon';
      Integer(RT_VERSION):
        result := 'Version';
      Integer(RT_DLGINCLUDE):
        result := 'Dialog Include';
      Integer(RT_PLUGPLAY):
        result := 'Plug and Play';
      Integer(RT_VXD):
        result := 'VxD';
      Integer(RT_ANICURSOR):
        result := 'Animated cursor';
      Integer(RT_ANIICON):
        result := 'Animated icon';
      Integer(RT_HTML):
        result := 'HTML resource';
      Integer(RT_MANIFEST):
        result := 'Side-by-Side Assembly Manifest';
      else
        result := Format('(Unknown type %d)', [Integer(AResourceType)]);
    end;
  end;
end;

Here is a demonstration of the code:
procedure TForm1.Button1Click(Sender: TObject);
begin
  // Hardware-dependent icon
  ShowMessage(GetHumanFriendlyResourceTypeName(MAKEINTRESOURCE(3)));

  // (Unknown type 123)
  ShowMessage(GetHumanFriendlyResourceTypeName(MAKEINTRESOURCE(123)));

  // AVI
  ShowMessage(GetHumanFriendlyResourceTypeName(PChar('AVI')));
end;

The performance is not as high as in your solution, but this function has several advantages:

This function is much easier to read since every RT_ constant is standing in front of its human-friendly name. So the code is also much better to maintain. In the LUT, the human-friendly names could be accidently interchanged (also since no comment in front of each human-friendly name indicates the official RT_ constant name).
This function does also show a nice human-friendly string "(Unknown type 123)" if the identifier is unknown.
This function will also dereference the string if it is not a predefined type (RT_)
Using this function you can internationalize your application either statically by putting the strings into resourcestrings or dynamically by querying a translation function/stringlist.

