Commit 6bdcbfe1 authored by Dmitry Antipov's avatar Dmitry Antipov

* buffer.c (Foverlays_at, Foverlays_in, Fnext_overlay_change)

(Fprevious_overlay_change): Fast path for buffer with no overlays.
parent 50b13cde
2013-08-28 Dmitry Antipov <dmantipov@yandex.ru>
* buffer.c (Foverlays_at, Foverlays_in, Fnext_overlay_change)
(Fprevious_overlay_change): Fast path for buffer with no overlays.
2013-08-28 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.in (SHELL): Now @SHELL@, not /bin/sh,
......
......@@ -4161,6 +4161,9 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0,
CHECK_NUMBER_COERCE_MARKER (pos);
if (!buffer_has_overlays ())
return Qnil;
len = 10;
/* We can't use alloca here because overlays_at can call xrealloc. */
overlay_vec = xmalloc (len * sizeof *overlay_vec);
......@@ -4193,6 +4196,9 @@ end of the buffer. */)
CHECK_NUMBER_COERCE_MARKER (beg);
CHECK_NUMBER_COERCE_MARKER (end);
if (!buffer_has_overlays ())
return Qnil;
len = 10;
overlay_vec = xmalloc (len * sizeof *overlay_vec);
......@@ -4221,6 +4227,9 @@ the value is (point-max). */)
CHECK_NUMBER_COERCE_MARKER (pos);
if (!buffer_has_overlays ())
return make_number (ZV);
len = 10;
overlay_vec = xmalloc (len * sizeof *overlay_vec);
......@@ -4260,6 +4269,9 @@ the value is (point-min). */)
CHECK_NUMBER_COERCE_MARKER (pos);
if (!buffer_has_overlays ())
return make_number (BEGV);
/* At beginning of buffer, we know the answer;
avoid bug subtracting 1 below. */
if (XINT (pos) == BEGV)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment