aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/compression/algorithm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/compression/algorithm.c')
-rw-r--r--src/core/compression/algorithm.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/core/compression/algorithm.c b/src/core/compression/algorithm.c
index 9624c52310..8e4e5c91d4 100644
--- a/src/core/compression/algorithm.c
+++ b/src/core/compression/algorithm.c
@@ -84,7 +84,7 @@ int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm,
case GRPC_COMPRESS_ALGORITHMS_COUNT:
return 0;
}
- GPR_UNREACHABLE_CODE(return 0);
+ return 0;
}
grpc_compression_algorithm grpc_compression_algorithm_from_mdstr(
@@ -119,8 +119,8 @@ grpc_mdelem *grpc_compression_encoding_mdelem(
return GRPC_MDELEM_GRPC_ENCODING_DEFLATE;
case GRPC_COMPRESS_GZIP:
return GRPC_MDELEM_GRPC_ENCODING_GZIP;
- case GRPC_COMPRESS_ALGORITHMS_COUNT:
- return NULL;
+ default:
+ break;
}
return NULL;
}
@@ -144,20 +144,6 @@ grpc_compression_algorithm grpc_compression_algorithm_for_level(
GPR_UNREACHABLE_CODE(return GRPC_COMPRESS_NONE);
}
-grpc_compression_level grpc_compression_level_for_algorithm(
- grpc_compression_algorithm algorithm) {
- grpc_compression_level clevel;
- GRPC_API_TRACE("grpc_compression_level_for_algorithm(algorithm=%d)", 1,
- ((int)algorithm));
- for (clevel = GRPC_COMPRESS_LEVEL_NONE; clevel < GRPC_COMPRESS_LEVEL_COUNT;
- ++clevel) {
- if (grpc_compression_algorithm_for_level(clevel) == algorithm) {
- return clevel;
- }
- }
- GPR_UNREACHABLE_CODE(return GRPC_COMPRESS_LEVEL_NONE);
-}
-
void grpc_compression_options_init(grpc_compression_options *opts) {
opts->enabled_algorithms_bitset = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1;
opts->default_compression_algorithm = GRPC_COMPRESS_NONE;