changeset 8686:c468db944aa2

(Fset_text_properties): Return early if buffer has no intervals and PROPS is nil.
author Richard M. Stallman <rms@gnu.org>
date Fri, 02 Sep 1994 23:27:04 +0000
parents 5952e691b975
children ae896adcb7a3
files src/textprop.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/textprop.c	Fri Sep 02 22:45:09 1994 +0000
+++ b/src/textprop.c	Fri Sep 02 23:27:04 1994 +0000
@@ -887,9 +887,18 @@
   if (NILP (object))
     XSET (object, Lisp_Buffer, current_buffer);
 
-  i = validate_interval_range (object, &start, &end, hard);
+  i = validate_interval_range (object, &start, &end, soft);
   if (NULL_INTERVAL_P (i))
-    return Qnil;
+    {
+      /* If buffer has no props, and we want none, return now.  */
+      if (NILP (props))
+	return Qnil;
+
+      i = validate_interval_range (object, &start, &end, hard);
+      /* This can return if start == end.  */
+      if (NULL_INTERVAL_P (i))
+	return Qnil;
+    }
 
   s = XINT (start);
   len = XINT (end) - s;