Find ChecksumHandler by type. Returns NULL if not found
| 46 | // Find ChecksumHandler by type. |
| 47 | // Returns NULL if not found |
| 48 | inline const ChecksumHandler* FindChecksumHandler(ChecksumType type) { |
| 49 | int index = type; |
| 50 | if (index < 0 || index >= MAX_HANDLER_SIZE) { |
| 51 | LOG(ERROR) << "ChecksumType=" << type << " is out of range"; |
| 52 | return NULL; |
| 53 | } |
| 54 | if (NULL == s_handler_map[index].Compute) { |
| 55 | return NULL; |
| 56 | } |
| 57 | return &s_handler_map[index]; |
| 58 | } |
| 59 | |
| 60 | const char* ChecksumTypeToCStr(ChecksumType type) { |
| 61 | if (type == CHECKSUM_TYPE_NONE) { |
no outgoing calls
no test coverage detected