Remove dead code from circpad_machine_remove_token().

This commit is contained in:
George Kadianakis 2019-06-29 19:38:14 +03:00
parent 6afe1b00c9
commit 0e4753e579
2 changed files with 7 additions and 5 deletions

3
changes/bug31027 Normal file
View file

@ -0,0 +1,3 @@
o Code simplification and refactoring:
- Remove some dead code from circpad_machine_remove_token() to fix some
Coverity warnings (CID 1447298). Fixes bug 31027; bugfix on 0.4.1.1-alpha.

View file

@ -1083,8 +1083,11 @@ circpad_machine_remove_token(circpad_machine_runtime_t *mi)
state = circpad_machine_current_state(mi); state = circpad_machine_current_state(mi);
/* If we are not in a padding state (like start or end), we're done */
if (!state)
return;
/* Don't remove any tokens if we're not doing token removal */ /* Don't remove any tokens if we're not doing token removal */
if (!state || state->token_removal == CIRCPAD_TOKEN_REMOVAL_NONE) if (state->token_removal == CIRCPAD_TOKEN_REMOVAL_NONE)
return; return;
current_time = monotime_absolute_usec(); current_time = monotime_absolute_usec();
@ -1103,10 +1106,6 @@ circpad_machine_remove_token(circpad_machine_runtime_t *mi)
timer_disable(mi->padding_timer); timer_disable(mi->padding_timer);
} }
/* If we are not in a padding state (like start or end), we're done */
if (!state)
return;
/* Perform the specified token removal strategy */ /* Perform the specified token removal strategy */
switch (state->token_removal) { switch (state->token_removal) {
case CIRCPAD_TOKEN_REMOVAL_CLOSEST_USEC: case CIRCPAD_TOKEN_REMOVAL_CLOSEST_USEC: