Repository: microsoft/garnet
File: libs/server/Resp/RespCommand.cs (C#)

Code before:
                                        {
                                            return (RespCommand.MEMORY, 0);
                                        }
                                        else if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("MODULE\r\n"u8))
                                        {
                                            return (RespCommand.MODULE, 0);
                                        }
                                        break;

                                    case 'R':
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("RPUSHX\r\n"u8))
                                        {
                                            return (RespCommand.List, (byte)ListOperation.RPUSHX);
                                        }
                                        break;

                                    case 'S':
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("SELECT\r\n"u8))
                                        {
                                            return (RespCommand.SELECT, 0);
                                        }
                                        else if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("STRLEN\r\n"u8))
                                        {
                                            return (RespCommand.STRLEN, 0);
                                        }
                                        else if (*(ulong*)(ptr + 2) == MemoryMarshal.Read<ulong>("\r\nSUNION\r\n"u8))
                                        {
                                            return (RespCommand.Set, (byte)SetOperation.SUNION);
                                        }
                                        break;

                                    case 'U':
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("UNLINK\r\n"u8))
                                        {
                                            return (RespCommand.UNLINK, 0);
                                        }
                                        break;

                                    case 'Z':
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("ZCOUNT\r\n"u8))
                                        {
                                            return (RespCommand.SortedSet, (byte)SortedSetOperation.ZCOUNT);
                                        }
                                        else if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("ZRANGE\r\n"u8))
                                        {
                                            return (RespCommand.SortedSet, (byte)SortedSetOperation.ZRANGE);
                                        }
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("ZSCORE\r\n"u8))
                                        {
                                            return (RespCommand.SortedSet, (byte)SortedSetOperation.ZSCORE);
                                        }

Review comment (suggestion):
Should be `*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("SUNION\r\n"u8)`

Code after:
                                        {
                                            return (RespCommand.MEMORY, 0);
                                        }
                                        else if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("MODULE\r\n"u8))
                                        {
                                            return (RespCommand.MODULE, 0);
                                        }
                                        break;

                                    case 'R':
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("RPUSHX\r\n"u8))
                                        {
                                            return (RespCommand.List, (byte)ListOperation.RPUSHX);
                                        }
                                        break;

                                    case 'S':
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("SELECT\r\n"u8))
                                        {
                                            return (RespCommand.SELECT, 0);
                                        }
                                        else if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("STRLEN\r\n"u8))
                                        {
                                            return (RespCommand.STRLEN, 0);
                                        }
                                        else if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("SUNION\r\n"u8))
                                        {
                                            return (RespCommand.Set, (byte)SetOperation.SUNION);
                                        }
                                        break;

                                    case 'U':
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("UNLINK\r\n"u8))
                                        {
                                            return (RespCommand.UNLINK, 0);
                                        }
                                        break;

                                    case 'Z':
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("ZCOUNT\r\n"u8))
                                        {
                                            return (RespCommand.SortedSet, (byte)SortedSetOperation.ZCOUNT);
                                        }
                                        else if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("ZRANGE\r\n"u8))
                                        {
                                            return (RespCommand.SortedSet, (byte)SortedSetOperation.ZRANGE);
                                        }
                                        if (*(ulong*)(ptr + 4) == MemoryMarshal.Read<ulong>("ZSCORE\r\n"u8))
                                        {
                                            return (RespCommand.SortedSet, (byte)SortedSetOperation.ZSCORE);
                                        }