Find CompressHandler by type. Returns NULL if not found
| 49 | // Find CompressHandler by type. |
| 50 | // Returns NULL if not found |
| 51 | const CompressHandler* FindCompressHandler(CompressType type) { |
| 52 | int index = type; |
| 53 | if (index < 0 || index >= MAX_HANDLER_SIZE) { |
| 54 | LOG(ERROR) << "CompressType=" << type << " is out of range"; |
| 55 | return NULL; |
| 56 | } |
| 57 | if (NULL == s_handler_map[index].Compress) { |
| 58 | return NULL; |
| 59 | } |
| 60 | return &s_handler_map[index]; |
| 61 | } |
| 62 | |
| 63 | const char* CompressTypeToCStr(CompressType type) { |
| 64 | if (type == COMPRESS_TYPE_NONE) { |
no outgoing calls
no test coverage detected