core/queue: Remove queue :: length()
Let's just access the q_length variable directly. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
281947aded
commit
a721a95604
|
@ -182,11 +182,6 @@ unsigned int queue :: size()
|
|||
return q_tracks.size();
|
||||
}
|
||||
|
||||
unsigned int queue :: length()
|
||||
{
|
||||
return q_length;
|
||||
}
|
||||
|
||||
class SortTracks {
|
||||
public:
|
||||
std::vector<struct sort_info> fields;
|
||||
|
|
|
@ -111,7 +111,7 @@ bool Tab :: tab_is_cur()
|
|||
|
||||
void Tab :: tab_runtime_changed()
|
||||
{
|
||||
gchar *len = string_sec2str_long(tab_pq->length());
|
||||
gchar *len = string_sec2str_long(tab_pq->q_length);
|
||||
if (tab_is_cur())
|
||||
gui :: get_widget<Gtk::Label>("o_queue_time")->set_text(len);
|
||||
g_free(len);
|
||||
|
|
|
@ -189,13 +189,6 @@ struct queue {
|
|||
*/
|
||||
unsigned int size();
|
||||
|
||||
/**
|
||||
* Find the runtime of the queue.
|
||||
*
|
||||
* @return The runtime of the queue.
|
||||
*/
|
||||
unsigned int length();
|
||||
|
||||
|
||||
/**
|
||||
* Add a new sort field to the queue. If the field is already in the
|
||||
|
|
|
@ -61,8 +61,8 @@ static void test_init()
|
|||
__test_init_core();
|
||||
|
||||
test_equal(q.q_cur, (unsigned int)-1);
|
||||
test_equal(q.q_flags, 0);
|
||||
test_equal(q.length(), 0);
|
||||
test_equal(q.q_flags, 0);
|
||||
test_equal(q.q_length, 0);
|
||||
test_equal(q.q_sort.size(), (size_t)0);
|
||||
test_equal(q.next(), (struct track *)NULL);
|
||||
test_not_equal(q.q_notify, NULL);
|
||||
|
@ -71,8 +71,8 @@ static void test_init()
|
|||
q.set_notifier(&test_notifier);
|
||||
|
||||
test_equal(q.q_cur, (unsigned int )-1);
|
||||
test_equal(q.q_flags, Q_ENABLED | Q_RANDOM);
|
||||
test_equal(q.length(), 0);
|
||||
test_equal(q.q_flags, Q_ENABLED | Q_RANDOM);
|
||||
test_equal(q.q_length, 0);
|
||||
test_equal(q.q_sort.size(), 0);
|
||||
test_equal(q.next(), (struct track *)NULL);
|
||||
test_equal(q.q_notify, &test_notifier);
|
||||
|
@ -124,7 +124,7 @@ static void test_stress(unsigned int N)
|
|||
test_loop_equal(q.add(track), i, i);
|
||||
test_loop_equal(count_added, i + 1, i);
|
||||
} test_loop_passed();
|
||||
test_equal(q.length(), ex_length);
|
||||
test_equal(q.q_length, ex_length);
|
||||
test_equal(q.size(), ex_size);
|
||||
|
||||
/* Queue :: del(struct track *) */
|
||||
|
@ -132,7 +132,7 @@ static void test_stress(unsigned int N)
|
|||
ex_length -= track->tr_length * (N / 13);
|
||||
ex_size -= (N / 13);
|
||||
q.del(track);
|
||||
test_equal(q.length(), ex_length);
|
||||
test_equal(q.q_length, ex_length);
|
||||
test_equal(q.size(), ex_size);
|
||||
|
||||
/* Queue :: del(unsigned int) */
|
||||
|
@ -143,7 +143,7 @@ static void test_stress(unsigned int N)
|
|||
test_loop_equal(q[i], track, i);
|
||||
q.del(i);
|
||||
} test_loop_passed();
|
||||
test_equal(q.length(), ex_length);
|
||||
test_equal(q.q_length, ex_length);
|
||||
test_equal(q.size(), ex_size);
|
||||
|
||||
/* Queue :: updated(struct track *) */
|
||||
|
@ -171,7 +171,7 @@ static void test_stress(unsigned int N)
|
|||
} test_loop_passed();
|
||||
|
||||
test_equal(q.size(), 0);
|
||||
test_equal(q.length(), 0);
|
||||
test_equal(q.q_length, 0);
|
||||
}
|
||||
|
||||
static void test_basics() { test_stress(13); }
|
||||
|
@ -319,7 +319,7 @@ static void test_save_load()
|
|||
file_close(&f);
|
||||
|
||||
test_equal(r.has_flag(Q_RANDOM), true);
|
||||
test_equal(r.length(), q.length());
|
||||
test_equal(r.q_length, q.q_length);
|
||||
test_equal(r.size(), 13);
|
||||
|
||||
for (i = 0; i < 13; i++) {
|
||||
|
|
Loading…
Reference in New Issue