[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] Assert that PER_BUFFER_IDX for Lisp variables is not 0
From: |
Spencer Baugh |
Subject: |
[PATCH 6/7] Assert that PER_BUFFER_IDX for Lisp variables is not 0 |
Date: |
Tue, 23 Mar 2021 23:11:56 -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 0fa491b17a..2de76099ca 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1709,8 +1709,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.28.0
- [PATCH 0/7] Cleanups and tests for DEFVAR_PER_BUFFER variables, Spencer Baugh, 2021/03/23
- [PATCH 3/7] Stop checking the constant default for enable_multibyte_characters, Spencer Baugh, 2021/03/23
- [PATCH 4/7] Take buffer field name in DEFVAR_PER_BUFFER, Spencer Baugh, 2021/03/23
- [PATCH 2/7] Assert not local-variable-p after setq in let_default binding, Spencer Baugh, 2021/03/23
- [PATCH 1/7] Add a test for let-binding unwinding, Spencer Baugh, 2021/03/23
- [PATCH 6/7] Assert that PER_BUFFER_IDX for Lisp variables is not 0,
Spencer Baugh <=
- [PATCH 5/7] Combine unnecessarily separate loops in buffer.c, Spencer Baugh, 2021/03/23
- [PATCH 7/7] Remove unnecessary Qunbound check, Spencer Baugh, 2021/03/23
- Re: [PATCH 0/7] Cleanups and tests for DEFVAR_PER_BUFFER variables, Eli Zaretskii, 2021/03/24