Skip to content

Commit 8081c9c

Browse files
committed
Cody tidy.
1 parent 31302a8 commit 8081c9c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/utils/time_range.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ static bool _z_time_range_parse_duration(const _z_str_se_t *bound, double *durat
4949
}
5050

5151
double multiplier = 1.0;
52-
switch (*(_z_cptr_char_offset(bound->end, -1))) {
52+
switch (*_z_cptr_char_offset(bound->end, -1)) {
5353
case 'u':
5454
multiplier = _Z_TIME_RANGE_U_TO_SECS;
5555
len--;
5656
break;
5757
case 's':
58-
if (len > 1 && *(_z_cptr_char_offset(bound->end, -2)) == 'm') {
58+
if (len > 1 && *_z_cptr_char_offset(bound->end, -2) == 'm') {
5959
multiplier = _Z_TIME_RANGE_MS_TO_SECS;
6060
len--;
6161
}
@@ -112,16 +112,16 @@ static bool _z_time_range_parse_time_bound(_z_str_se_t *str, bool inclusive, _z_
112112
} else if (len >= 5) {
113113
bound->bound = inclusive ? _Z_TIME_BOUND_INCLUSIVE : _Z_TIME_BOUND_EXCLUSIVE;
114114

115-
if (*(str->start) == 'n' && *(_z_cptr_char_offset(str->start, 1)) == 'o' &&
116-
*(_z_cptr_char_offset(str->start, 2)) == 'w' && *(_z_cptr_char_offset(str->start, 3)) == '(' &&
117-
*(_z_cptr_char_offset(str->end, -1)) == ')') {
115+
if (*str->start == 'n' && *_z_cptr_char_offset(str->start, 1) == 'o' &&
116+
*_z_cptr_char_offset(str->start, 2) == 'w' && *_z_cptr_char_offset(str->start, 3) == '(' &&
117+
*_z_cptr_char_offset(str->end, -1) == ')') {
118118
if (len == 5) {
119119
bound->now_offset = 0;
120120
} else {
121121
_z_str_se_t duration = {.start = _z_cptr_char_offset(str->start, 4),
122122
.end = _z_cptr_char_offset(str->end, -1)};
123123

124-
if (!_z_time_range_parse_duration(&duration, &(bound->now_offset))) {
124+
if (!_z_time_range_parse_duration(&duration, &bound->now_offset)) {
125125
return false;
126126
}
127127
}
@@ -167,8 +167,8 @@ bool _z_time_range_from_str(const char *str, size_t len, _z_time_range_t *range)
167167
_z_str_se_t start_str = {.start = _z_cptr_char_offset(str, 1), .end = separator};
168168
_z_str_se_t end_str = {.start = _z_cptr_char_offset(separator, 2), .end = _z_cptr_char_offset(str, len - 1)};
169169

170-
if (!_z_time_range_parse_time_bound(&start_str, inclusive_start, &(range->start)) ||
171-
!_z_time_range_parse_time_bound(&end_str, inclusive_end, &(range->end))) {
170+
if (!_z_time_range_parse_time_bound(&start_str, inclusive_start, &range->start) ||
171+
!_z_time_range_parse_time_bound(&end_str, inclusive_end, &range->end)) {
172172
return false;
173173
}
174174
} else {
@@ -181,7 +181,7 @@ bool _z_time_range_from_str(const char *str, size_t len, _z_time_range_t *range)
181181
_z_str_se_t start_str = {.start = _z_cptr_char_offset(str, 1), .end = separator};
182182
_z_str_se_t end_str = {.start = _z_cptr_char_offset(separator, 1), .end = _z_cptr_char_offset(str, len - 1)};
183183

184-
if (!_z_time_range_parse_time_bound(&start_str, inclusive_start, &(range->start)) ||
184+
if (!_z_time_range_parse_time_bound(&start_str, inclusive_start, &range->start) ||
185185
range->start.bound == _Z_TIME_BOUND_UNBOUNDED) {
186186
return false;
187187
}

0 commit comments

Comments
 (0)