Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0f12ec4

Browse files
authored
Merge pull request #296 from Mike1117/fix/drop-size
Fix incorrect DROP_SIZE usage
2 parents 55065d7 + 3312405 commit 0f12ec4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎dudect/constant.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ bool measure(int64_t *before_ticks,
7777

7878
switch (mode) {
7979
case DUT(insert_head):
80-
for (size_t i = DROP_SIZE; i < N_MEASURES-DROP_SIZE; i++) {
80+
for (size_t i = 0; i < N_MEASURES; i++) {
8181
char *s = get_random_string();
8282
dut_new();
8383
dut_insert_head(
@@ -94,7 +94,7 @@ bool measure(int64_t *before_ticks,
9494
}
9595
break;
9696
case DUT(insert_tail):
97-
for (size_t i = DROP_SIZE; i < N_MEASURES-DROP_SIZE; i++) {
97+
for (size_t i = 0; i < N_MEASURES; i++) {
9898
char *s = get_random_string();
9999
dut_new();
100100
dut_insert_head(
@@ -111,7 +111,7 @@ bool measure(int64_t *before_ticks,
111111
}
112112
break;
113113
case DUT(remove_head):
114-
for (size_t i = DROP_SIZE; i < N_MEASURES-DROP_SIZE; i++) {
114+
for (size_t i = 0; i < N_MEASURES; i++) {
115115
dut_new();
116116
dut_insert_head(
117117
get_random_string(),
@@ -129,7 +129,7 @@ bool measure(int64_t *before_ticks,
129129
}
130130
break;
131131
case DUT(remove_tail):
132-
for (size_t i = DROP_SIZE; i < N_MEASURES-DROP_SIZE; i++) {
132+
for (size_t i = 0; i < N_MEASURES; i++) {
133133
dut_new();
134134
dut_insert_head(
135135
get_random_string(),
@@ -147,7 +147,7 @@ bool measure(int64_t *before_ticks,
147147
}
148148
break;
149149
default:
150-
for (size_t i = DROP_SIZE; i < N_MEASURES-DROP_SIZE; i++) {
150+
for (size_t i = 0; i < N_MEASURES; i++) {
151151
dut_new();
152152
dut_insert_head(
153153
get_random_string(),

‎dudect/fixture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void update_statistics(const int64_t *exec_times,
103103
uint8_t *classes,
104104
int64_t *percentiles)
105105
{
106-
for (size_t i = 0; i < N_MEASURES; i++) {
106+
for (size_t i = DROP_SIZE; i < N_MEASURES-DROP_SIZE; i++) {
107107
int64_t difference = exec_times[i];
108108
/* CPU cycle counter overflowed or dropped measurement */
109109
if (difference <= 0)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /