diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-23 08:46:35 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-29 09:05:11 -0400 |
commit | 4903ab1caaf0b2631e6091b58b31eaff0c9f8424 (patch) | |
tree | bfd51b9ea637076a90f331e02c2367a18ee23ac2 /src/test | |
parent | 8527a2996675d9502551ccdd4224036a45aae47b (diff) | |
download | tor-4903ab1caaf0b2631e6091b58b31eaff0c9f8424.tar.gz tor-4903ab1caaf0b2631e6091b58b31eaff0c9f8424.zip |
Avoid frequent strcmp() calls for AccountingRule
Generally, we don't like to parse the same thing over and over; it's
best IMO to do it once at the start of the code.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_accounting.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_accounting.c b/src/test/test_accounting.c index a1a2ec643e..25908e942c 100644 --- a/src/test/test_accounting.c +++ b/src/test/test_accounting.c @@ -34,7 +34,7 @@ test_accounting_limits(void *arg) or_state = or_state_new(); options->AccountingMax = 100; - options->AccountingRule = tor_strdup("max"); + options->AccountingRule = ACCT_MAX; tor_assert(accounting_is_enabled(options)); configure_accounting(fake_time); @@ -50,7 +50,7 @@ test_accounting_limits(void *arg) tor_assert(we_are_hibernating() == 1); options->AccountingMax = 200; - options->AccountingRule = tor_strdup("sum"); + options->AccountingRule = ACCT_SUM; accounting_add_bytes(0, 10, 1); fake_time += 1; |