diff options
| author | Mattias EngdegÄrd | 2023-04-10 15:07:24 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2023-04-10 15:12:01 +0200 |
| commit | 119a7dd22084fe20da7b2fddd41a63870da89bda (patch) | |
| tree | 42a4dca9b85615222363afd5c263eeae09035ef2 | |
| parent | ab8153b3bbafe2a06c0a4dffeab83448dc3e5600 (diff) | |
| download | emacs-119a7dd22084fe20da7b2fddd41a63870da89bda.tar.gz emacs-119a7dd22084fe20da7b2fddd41a63870da89bda.zip | |
ebnf2ps: eliminate double nreverse
* lisp/progmodes/ebnf-otz.el (ebnf-split-suffix): Simplify code that
relied on a rather inobvious in-place reversal of a list twice for
correctness, silencing a byte-compiler warning.
| -rw-r--r-- | lisp/progmodes/ebnf-otz.el | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lisp/progmodes/ebnf-otz.el b/lisp/progmodes/ebnf-otz.el index 9ac37b676f9..4155dc0d2cd 100644 --- a/lisp/progmodes/ebnf-otz.el +++ b/lisp/progmodes/ebnf-otz.el | |||
| @@ -566,7 +566,7 @@ | |||
| 566 | ;; determine suffix length | 566 | ;; determine suffix length |
| 567 | (while (and (> isuf 0) (setq tail (cdr tail))) | 567 | (while (and (> isuf 0) (setq tail (cdr tail))) |
| 568 | (let* ((cur head) | 568 | (let* ((cur head) |
| 569 | (tlis (nreverse | 569 | (tlis (reverse |
| 570 | (if (eq (ebnf-node-kind (car tail)) 'ebnf-generate-sequence) | 570 | (if (eq (ebnf-node-kind (car tail)) 'ebnf-generate-sequence) |
| 571 | (ebnf-node-list (car tail)) | 571 | (ebnf-node-list (car tail)) |
| 572 | (list (car tail))))) | 572 | (list (car tail))))) |
| @@ -577,7 +577,6 @@ | |||
| 577 | (setq cur (cdr cur) | 577 | (setq cur (cdr cur) |
| 578 | this (cdr this) | 578 | this (cdr this) |
| 579 | i (1+ i))) | 579 | i (1+ i))) |
| 580 | (nreverse tlis) | ||
| 581 | (setq isuf (min isuf i)))) | 580 | (setq isuf (min isuf i)))) |
| 582 | (setq head (nreverse head)) | 581 | (setq head (nreverse head)) |
| 583 | (if (or (zerop isuf) (> isuf len)) | 582 | (if (or (zerop isuf) (> isuf len)) |