Skip to content

Commit

Permalink
packet counter: removed unused function
Browse files Browse the repository at this point in the history
+ optimized includes + using
  • Loading branch information
MartinPulec committed Aug 1, 2023
1 parent 7f810b8 commit 2e03e67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
25 changes: 3 additions & 22 deletions src/utils/packet_counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,12 @@
#endif // defined HAVE_CONFIG_H

#include "utils/packet_counter.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <cassert>
#include <map>
#include <vector>

#include "debug.h"

using namespace std;
using std::map;
using std::vector;

struct packet_counter {
explicit packet_counter(int ns)
Expand All @@ -67,14 +62,6 @@ struct packet_counter {
current_frame[substream_id][offset] = len;
}

bool has_packet(int substream_id, int bufnum, int offset, int len) {
UNUSED(len);
assert(substream_id < num_substreams);

return cumulative[substream_id][bufnum][offset] != 0;
}


int get_total_bytes() {
int ret = 0;

Expand Down Expand Up @@ -168,12 +155,6 @@ void packet_counter_register_packet(struct packet_counter *state, unsigned int s
state->register_packet(substream_id, bufnum, offset, len);
}

bool packet_counter_has_packet(struct packet_counter *state, unsigned int substream_id,
unsigned int bufnum, unsigned int offset, unsigned int len)
{
return state->has_packet(substream_id, bufnum, offset, len);
}

int packet_counter_get_total_bytes(struct packet_counter *state)
{
return state->get_total_bytes();
Expand Down
2 changes: 0 additions & 2 deletions src/utils/packet_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ struct packet_counter *packet_counter_init(int num_substreams);
void packet_counter_destroy(struct packet_counter *state);
void packet_counter_register_packet(struct packet_counter *state, unsigned int substream_id,
unsigned int bufnum, unsigned int offset, unsigned int len);
bool packet_counter_has_packet(struct packet_counter *state, unsigned int substream_id,
unsigned int bufnum, unsigned int offset, unsigned int len);
int packet_counter_get_total_bytes(struct packet_counter *state);
int packet_counter_get_all_bytes(struct packet_counter *state);
int packet_counter_get_channels(struct packet_counter *state);
Expand Down

0 comments on commit 2e03e67

Please sign in to comment.