aboutsummaryrefslogtreecommitdiffstats
path: root/src/dired.c
diff options
context:
space:
mode:
authorDmitry Antipov2015-01-14 09:50:39 +0300
committerDmitry Antipov2015-01-14 09:50:39 +0300
commit01ebf7a3655541ef09cee068bddffbc1b38c69c8 (patch)
tree41300cd8f3167f16aebc536d8322dbc757eb4f5a /src/dired.c
parent3ef29501b029567156440d257c758b99099213fe (diff)
downloademacs-01ebf7a3655541ef09cee068bddffbc1b38c69c8.tar.gz
emacs-01ebf7a3655541ef09cee068bddffbc1b38c69c8.zip
Avoid extra multibyteness check in ENCODE_FILE users.
* callproc.c (encode_current_directory, Fcall_process, call_process): * dired.c (directory_files_internal, file_name_completion): Do not check for STRING_MULTIBYTE because encode_file_name is a no-op for unibyte strings.
Diffstat (limited to 'src/dired.c')
-rw-r--r--src/dired.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/dired.c b/src/dired.c
index 9026c5678ef..ca43cd90219 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -176,10 +176,8 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
176 /* Note: ENCODE_FILE and DECODE_FILE can GC because they can run 176 /* Note: ENCODE_FILE and DECODE_FILE can GC because they can run
177 run_pre_post_conversion_on_str which calls Lisp directly and 177 run_pre_post_conversion_on_str which calls Lisp directly and
178 indirectly. */ 178 indirectly. */
179 if (STRING_MULTIBYTE (dirfilename)) 179 dirfilename = ENCODE_FILE (dirfilename);
180 dirfilename = ENCODE_FILE (dirfilename); 180 encoded_directory = ENCODE_FILE (directory);
181 encoded_directory = (STRING_MULTIBYTE (directory)
182 ? ENCODE_FILE (directory) : directory);
183 181
184 /* Now *bufp is the compiled form of MATCH; don't call anything 182 /* Now *bufp is the compiled form of MATCH; don't call anything
185 which might compile a new regexp until we're done with the loop! */ 183 which might compile a new regexp until we're done with the loop! */
@@ -482,7 +480,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
482 /* Actually, this is not quite true any more: we do most of the completion 480 /* Actually, this is not quite true any more: we do most of the completion
483 work with decoded file names, but we still do some filtering based 481 work with decoded file names, but we still do some filtering based
484 on the encoded file name. */ 482 on the encoded file name. */
485 encoded_file = STRING_MULTIBYTE (file) ? ENCODE_FILE (file) : file; 483 encoded_file = ENCODE_FILE (file);
486 484
487 encoded_dir = ENCODE_FILE (Fdirectory_file_name (dirname)); 485 encoded_dir = ENCODE_FILE (Fdirectory_file_name (dirname));
488 486