bool ZstdDecompressorImpl::isError(size_t result) {
  switch (ZSTD_getErrorCode(result)) {
  case ZSTD_error_no_error:
    return false;
  case ZSTD_error_memory_allocation:
    stats_.zstd_memory_error_.inc();
    break;
  case ZSTD_error_dictionary_corrupted:
  case ZSTD_error_dictionary_wrong:
    stats_.zstd_dictionary_error_.inc();
    break;
  case ZSTD_error_checksum_wrong:
    stats_.zstd_checksum_wrong_error_.inc();
    break;
  default:
    stats_.zstd_generic_error_.inc();
    break;
  }
  return true;
}
bool ZstdDecompressorImpl::isError(size_t result) {
  switch (ZSTD_getErrorCode(result)) {
  case ZSTD_error_no_error:
    return false;
  case ZSTD_error_memory_allocation:
    stats_.zstd_memory_error_.inc();
    break;
  case ZSTD_error_dictionary_corrupted:
  case ZSTD_error_dictionary_wrong:
    stats_.zstd_dictionary_error_.inc();
    break;
  case ZSTD_error_checksum_wrong:
    stats_.zstd_checksum_wrong_error_.inc();
    break;
  default:
    stats_.zstd_generic_error_.inc();
    break;
  }
  return true;
}