diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-27 21:01:04 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-27 21:24:26 -0700 |
commit | eac5f967ca700c5f47cf673cb4c06b07c4f42ac2 (patch) | |
tree | 6f1a438a8f3d6f5be6a94e8ae0b6c8a0ab114efb /src | |
parent | 361e88986f3580a7433a23eec1cf01408e5e3627 (diff) | |
download | emacs-eac5f967ca700c5f47cf673cb4c06b07c4f42ac2.tar.gz emacs-eac5f967ca700c5f47cf673cb4c06b07c4f42ac2.tar.bz2 emacs-eac5f967ca700c5f47cf673cb4c06b07c4f42ac2.zip |
No need for m_search_regs_saved in thread.h
* src/search.c (save_search_regs, restore_search_regs):
Don’t use m_search_regs_saved; it’s equivalent to
saved_search_regs.num_regs != 0.
* src/thread.h (struct thread_state): Remove m_search_regs_saved.
Diffstat (limited to 'src')
-rw-r--r-- | src/search.c | 16 | ||||
-rw-r--r-- | src/thread.h | 5 |
2 files changed, 5 insertions, 16 deletions
diff --git a/src/search.c b/src/search.c index e55aa767f11..e15e2b94e5f 100644 --- a/src/search.c +++ b/src/search.c @@ -3059,18 +3059,14 @@ If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */) static void save_search_regs (void) { - if (!search_regs_saved) + if (saved_search_regs.num_regs == 0) { - saved_search_regs.num_regs = search_regs.num_regs; - saved_search_regs.start = search_regs.start; - saved_search_regs.end = search_regs.end; + saved_search_regs = search_regs; saved_last_thing_searched = last_thing_searched; last_thing_searched = Qnil; search_regs.num_regs = 0; search_regs.start = 0; search_regs.end = 0; - - search_regs_saved = 1; } } @@ -3078,19 +3074,17 @@ save_search_regs (void) void restore_search_regs (void) { - if (search_regs_saved) + if (saved_search_regs.num_regs != 0) { if (search_regs.num_regs > 0) { xfree (search_regs.start); xfree (search_regs.end); } - search_regs.num_regs = saved_search_regs.num_regs; - search_regs.start = saved_search_regs.start; - search_regs.end = saved_search_regs.end; + search_regs = saved_search_regs; last_thing_searched = saved_last_thing_searched; saved_last_thing_searched = Qnil; - search_regs_saved = 0; + saved_search_regs.num_regs = 0; } } diff --git a/src/thread.h b/src/thread.h index 1856fddf4cd..50f8f5cbe0a 100644 --- a/src/thread.h +++ b/src/thread.h @@ -131,11 +131,6 @@ struct thread_state struct re_registers m_search_regs; #define search_regs (current_thread->m_search_regs) - /* If non-zero the match data have been saved in saved_search_regs - during the execution of a sentinel or filter. */ - bool m_search_regs_saved; -#define search_regs_saved (current_thread->m_search_regs_saved) - struct re_registers m_saved_search_regs; #define saved_search_regs (current_thread->m_saved_search_regs) |