mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Remove a needless memset() in get_token_arguments()
I believe we originally added this for "just in case" safety, but it isn't actually needed -- we never copy uninitialized stack here. What's more, this one memset is showing up on our startup profiles, so we ought to remove it. Closes ticket 28852.
This commit is contained in:
parent
f8dac5c900
commit
9dc53bc68f
2 changed files with 4 additions and 1 deletions
4
changes/ticket28852
Normal file
4
changes/ticket28852
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
o Minor features (performance):
|
||||||
|
- Remove a needless memset() call from get_token_arguments,
|
||||||
|
thereby speeding up the tokenization of directory objects by about
|
||||||
|
20%. Closes ticket 28852.
|
|
@ -169,7 +169,6 @@ get_token_arguments(memarea_t *area, directory_token_t *tok,
|
||||||
char *cp = mem;
|
char *cp = mem;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
char *args[MAX_ARGS];
|
char *args[MAX_ARGS];
|
||||||
memset(args, 0, sizeof(args));
|
|
||||||
while (*cp) {
|
while (*cp) {
|
||||||
if (j == MAX_ARGS)
|
if (j == MAX_ARGS)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue