Avoid calls to strlen in miscellaneous functions.

* buffer.c (init_buffer): Use precalculated len, adjust if needed.
* font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
* lread.c (openp): Likewise.
This commit is contained in:
Dmitry Antipov
2012-07-10 11:59:31 +04:00
parent d02eb359e6
commit cb1caeaf2b
4 changed files with 28 additions and 15 deletions

View File

@@ -5091,9 +5091,10 @@ init_buffer (void)
fatal ("`get_current_dir_name' failed: %s\n", strerror (errno));
pwd[len] = DIRECTORY_SEP;
pwd[len + 1] = '\0';
len++;
}
BVAR (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd));
BVAR (current_buffer, directory) = make_unibyte_string (pwd, len);
if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
/* At this moment, we still don't know how to decode the
directory name. So, we keep the bytes in multibyte form so