mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-31 14:01:18 +08:00
getenv: Move call to strlen to the branch it's used in.
The len variable is only used in the else branch. We don't need the call to strlen if the name is 0 or 1 characters long. 2019-10-02 Lode Willems <Lode.Willems@UGent.be> * tdlib/getenv.c: Move the call to strlen into the branch it's used.
This commit is contained in:
parent
2ec40e66ad
commit
59d572ef61
@ -32,7 +32,6 @@
|
||||
char *
|
||||
getenv (const char *name)
|
||||
{
|
||||
size_t len = strlen (name);
|
||||
char **ep;
|
||||
uint16_t name_start;
|
||||
|
||||
@ -63,6 +62,7 @@ getenv (const char *name)
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t len = strlen (name);
|
||||
#if _STRING_ARCH_unaligned
|
||||
name_start = *(const uint16_t *) name;
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user