From facc570e2b1f74c98ccd7808cc7601c01bfa9f63 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 2 Sep 1994 23:27:04 +0000 Subject: [PATCH 1/1] (Fset_text_properties): Return early if buffer has no intervals and PROPS is nil. --- src/textprop.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/textprop.c b/src/textprop.c index fc09dc41d8..b6e8039adf 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -887,9 +887,18 @@ is the string or buffer containing the text.") 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; -- 2.20.1