summaryrefslogtreecommitdiff
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorAndreas Politz <politza@hochschule-trier.de>2017-10-09 08:22:43 +0200
committerAndreas Politz <politza@hochschule-trier.de>2017-10-09 08:22:43 +0200
commit8869332684c2302b5ba1ead4568bbc7ba1c0183e (patch)
treea28ca47b5064e0c12b1d9f636ef04948989cf301 /src/xdisp.c
parenta38c38c0526894ff05e2317994703c1157d5f909 (diff)
downloademacs-8869332684c2302b5ba1ead4568bbc7ba1c0183e.tar.gz
Remove redundant checks for the empty overlay treefeature/noverlay
* src/alloc.c (mark_buffer): Remove b->overlays check. * src/buffer.c (copy_overlays): Also. * src/buffer.c (swap_buffer_overlays, overlays_in): Also. (next_overlay_change, previous_overlay_change): Also. (overlay_touches_p, Foverlay_lists): Also. (evaporate_overlays): Also. * src/xdisp.c (load_overlay_strings): Also.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c82
1 files changed, 40 insertions, 42 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index b3b9ecae377..f94643b1f7b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5790,48 +5790,46 @@ load_overlay_strings (struct it *it, ptrdiff_t charpos)
} \
while (false)
- if (current_buffer->overlays)
- {
- buffer_overlay_iter_start (current_buffer,
- charpos - 1, charpos + 1, ITREE_DESCENDING);
- /* Process overlays. */
- while ((node = buffer_overlay_iter_next (current_buffer)))
- {
- overlay = node->data;
- eassert (OVERLAYP (overlay));
- start = node->begin;
- end = node->end;
-
- /* Skip this overlay if it doesn't start or end at IT's current
- position. */
- if (end != charpos && start != charpos)
- continue;
-
- /* Skip this overlay if it doesn't apply to IT->w. */
- window = Foverlay_get (overlay, Qwindow);
- if (WINDOWP (window) && XWINDOW (window) != it->w)
- continue;
-
- /* If the text ``under'' the overlay is invisible, both before-
- and after-strings from this overlay are visible; start and
- end position are indistinguishable. */
- invisible = Foverlay_get (overlay, Qinvisible);
- invis = TEXT_PROP_MEANS_INVISIBLE (invisible);
-
- /* If overlay has a non-empty before-string, record it. */
- if ((start == charpos || (end == charpos && invis != 0))
- && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str))
- && SCHARS (str))
- RECORD_OVERLAY_STRING (overlay, str, false);
-
- /* If overlay has a non-empty after-string, record it. */
- if ((end == charpos || (start == charpos && invis != 0))
- && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str))
- && SCHARS (str))
- RECORD_OVERLAY_STRING (overlay, str, true);
- }
- buffer_overlay_iter_finish (current_buffer);
- }
+
+ buffer_overlay_iter_start (current_buffer,
+ charpos - 1, charpos + 1, ITREE_DESCENDING);
+ /* Process overlays. */
+ while ((node = buffer_overlay_iter_next (current_buffer)))
+ {
+ overlay = node->data;
+ eassert (OVERLAYP (overlay));
+ start = node->begin;
+ end = node->end;
+
+ /* Skip this overlay if it doesn't start or end at IT's current
+ position. */
+ if (end != charpos && start != charpos)
+ continue;
+
+ /* Skip this overlay if it doesn't apply to IT->w. */
+ window = Foverlay_get (overlay, Qwindow);
+ if (WINDOWP (window) && XWINDOW (window) != it->w)
+ continue;
+
+ /* If the text ``under'' the overlay is invisible, both before-
+ and after-strings from this overlay are visible; start and
+ end position are indistinguishable. */
+ invisible = Foverlay_get (overlay, Qinvisible);
+ invis = TEXT_PROP_MEANS_INVISIBLE (invisible);
+
+ /* If overlay has a non-empty before-string, record it. */
+ if ((start == charpos || (end == charpos && invis != 0))
+ && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str))
+ && SCHARS (str))
+ RECORD_OVERLAY_STRING (overlay, str, false);
+
+ /* If overlay has a non-empty after-string, record it. */
+ if ((end == charpos || (start == charpos && invis != 0))
+ && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str))
+ && SCHARS (str))
+ RECORD_OVERLAY_STRING (overlay, str, true);
+ }
+ buffer_overlay_iter_finish (current_buffer);
#undef RECORD_OVERLAY_STRING