Subject: bug#48264: [PATCH v3 13/15] Assert that PER_BUFFER_IDX for Lisp variables is not 0

From: Spencer Baugh <[email-masked]>
Date: Thu, 6 May 2021 17:33:44 -0400

PER_BUFFER_IDX can't be 0 for Lisp variables - so this if-check was
always pointless.

* src/data.c (default_value): Change if to eassert
---
 src/data.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/data.c b/src/data.c
index 49a4bc3bea..4e58c6c815 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1758,8 +1758,8 @@ default_value (Lisp_Object symbol)
 	if (BUFFER_OBJFWDP (valcontents))
 	  {
 	    int offset = XBUFFER_OBJFWD (valcontents)->offset;
-	    if (PER_BUFFER_IDX (offset) != 0)
-	      return per_buffer_default (offset);
+	    eassert (PER_BUFFER_IDX (offset) != 0);
+            return per_buffer_default (offset);
 	  }
 
 	/* For other variables, get the current value.  */
-- 
2.31.1