diff options
| author | Dmitry Antipov | 2014-09-01 20:05:43 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-09-01 20:05:43 +0400 |
| commit | 50e9e580077869b2f2ced5916299bade6b4f4efd (patch) | |
| tree | 911756b76f580c119c080770ff895e6955f0be95 /src/callproc.c | |
| parent | 203fb3639ace0e05284d9be5aa5c3d63701f33a4 (diff) | |
| download | emacs-50e9e580077869b2f2ced5916299bade6b4f4efd.tar.gz emacs-50e9e580077869b2f2ced5916299bade6b4f4efd.zip | |
Avoid extra calls to strlen in filesystem I/O routines.
* fileio.c (Fexpand_file_name): Avoid calls to strlen if
the length of 'newdir' is known or may be precalculated.
(file_accessible_directory_p): Prefer to pass Lisp_Object,
not 'char *', and so use precalculated length.
(Ffile_accessible_directory_p):
* callproc.c (encode_current_directory, init_callproc):
* charset.c (init_charset):
* lread.c (load_path_check, load_path_default): Adjust users.
* lisp.h (file_accessible_directory_p): Tweak prototype.
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/callproc.c b/src/callproc.c index 2f68ea6f328..01008312155 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -129,7 +129,7 @@ encode_current_directory (void) | |||
| 129 | 129 | ||
| 130 | if (STRING_MULTIBYTE (dir)) | 130 | if (STRING_MULTIBYTE (dir)) |
| 131 | dir = ENCODE_FILE (dir); | 131 | dir = ENCODE_FILE (dir); |
| 132 | if (! file_accessible_directory_p (SSDATA (dir))) | 132 | if (! file_accessible_directory_p (dir)) |
| 133 | report_file_error ("Setting current directory", | 133 | report_file_error ("Setting current directory", |
| 134 | BVAR (current_buffer, directory)); | 134 | BVAR (current_buffer, directory)); |
| 135 | 135 | ||
| @@ -1625,12 +1625,12 @@ init_callproc (void) | |||
| 1625 | #endif | 1625 | #endif |
| 1626 | { | 1626 | { |
| 1627 | tempdir = Fdirectory_file_name (Vexec_directory); | 1627 | tempdir = Fdirectory_file_name (Vexec_directory); |
| 1628 | if (! file_accessible_directory_p (SSDATA (tempdir))) | 1628 | if (! file_accessible_directory_p (tempdir)) |
| 1629 | dir_warning ("arch-dependent data dir", Vexec_directory); | 1629 | dir_warning ("arch-dependent data dir", Vexec_directory); |
| 1630 | } | 1630 | } |
| 1631 | 1631 | ||
| 1632 | tempdir = Fdirectory_file_name (Vdata_directory); | 1632 | tempdir = Fdirectory_file_name (Vdata_directory); |
| 1633 | if (! file_accessible_directory_p (SSDATA (tempdir))) | 1633 | if (! file_accessible_directory_p (tempdir)) |
| 1634 | dir_warning ("arch-independent data dir", Vdata_directory); | 1634 | dir_warning ("arch-independent data dir", Vdata_directory); |
| 1635 | 1635 | ||
| 1636 | sh = getenv ("SHELL"); | 1636 | sh = getenv ("SHELL"); |