diff options
author | Muxi Yan <mxyan@google.com> | 2017-09-25 12:38:35 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-09-25 12:38:35 -0700 |
commit | 68ee7ce732f7c45f0cf85d672ef38542639244c6 (patch) | |
tree | 5b3c083f9978c8c0efed408572f41dccdacb54f0 /src/core/lib/slice | |
parent | 1c285b98122ef8fe31aa3325a4c10f5b05107ca8 (diff) |
clang-format
Diffstat (limited to 'src/core/lib/slice')
-rw-r--r-- | src/core/lib/slice/slice_string_helpers.c | 12 | ||||
-rw-r--r-- | src/core/lib/slice/slice_string_helpers.h | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/core/lib/slice/slice_string_helpers.c b/src/core/lib/slice/slice_string_helpers.c index e2d8c662f3..3f054daf32 100644 --- a/src/core/lib/slice/slice_string_helpers.c +++ b/src/core/lib/slice/slice_string_helpers.c @@ -56,7 +56,8 @@ static int slice_find_separator_offset(const grpc_slice str, const char *sep, return 0; } -static void skip_leading_trailing_spaces(const uint8_t *str_buffer, size_t *begin, size_t *end) { +static void skip_leading_trailing_spaces(const uint8_t *str_buffer, + size_t *begin, size_t *end) { while (*begin < *end && str_buffer[*begin] == ' ') { (*begin)++; } @@ -65,7 +66,8 @@ static void skip_leading_trailing_spaces(const uint8_t *str_buffer, size_t *begi } } -static void grpc_slice_split_inner(grpc_slice str, const char *sep, grpc_slice_buffer *dst, bool no_space) { +static void grpc_slice_split_inner(grpc_slice str, const char *sep, + grpc_slice_buffer *dst, bool no_space) { const size_t sep_len = strlen(sep); size_t begin, end; const uint8_t *str_buffer = GRPC_SLICE_START_PTR(str); @@ -87,8 +89,7 @@ static void grpc_slice_split_inner(grpc_slice str, const char *sep, grpc_slice_b if (no_space) { skip_leading_trailing_spaces(str_buffer, &begin, &end); } - grpc_slice_buffer_add_indexed( - dst, grpc_slice_sub(str, begin, end)); + grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end)); } else { /* no sep found, add whole input */ begin = 0; end = GRPC_SLICE_LENGTH(str); @@ -103,7 +104,8 @@ void grpc_slice_split(grpc_slice str, const char *sep, grpc_slice_buffer *dst) { grpc_slice_split_inner(str, sep, dst, false); } -void grpc_slice_split_without_space(grpc_slice str, const char *sep, grpc_slice_buffer *dst) { +void grpc_slice_split_without_space(grpc_slice str, const char *sep, + grpc_slice_buffer *dst) { grpc_slice_split_inner(str, sep, dst, true); } diff --git a/src/core/lib/slice/slice_string_helpers.h b/src/core/lib/slice/slice_string_helpers.h index 86125abec3..c034eb3ad8 100644 --- a/src/core/lib/slice/slice_string_helpers.h +++ b/src/core/lib/slice/slice_string_helpers.h @@ -42,7 +42,8 @@ void grpc_slice_split(grpc_slice str, const char *sep, grpc_slice_buffer *dst); /** Split \a str by the separator \a sep and remove the leading and trailing * spaces of each resulting token. Results are stored in \a dst, which should be * a properly initialized instance. */ -void grpc_slice_split_without_space(grpc_slice str, const char *sep, grpc_slice_buffer *dst); +void grpc_slice_split_without_space(grpc_slice str, const char *sep, + grpc_slice_buffer *dst); bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t *result); |