diff options
| author | Manuel Giraud | 2025-06-13 11:25:15 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-06-21 12:39:56 +0300 |
| commit | d7e55558759dc7be0c38a8c8d508be1909b20aa4 (patch) | |
| tree | 2020ca79ac5640d792e166f6dea51d089184e6ba | |
| parent | 60fbeda771639ded68ffd0666df340c7a06cafcf (diff) | |
| download | emacs-d7e55558759dc7be0c38a8c8d508be1909b20aa4.tar.gz emacs-d7e55558759dc7be0c38a8c8d508be1909b20aa4.zip | |
Avoid rebuilding a static alist inside a loop
* lisp/calendar/diary-lib.el (diary-mark-entries-1): Build
months-alist outside of the loop. (Bug#78779)
| -rw-r--r-- | lisp/calendar/diary-lib.el | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 4fdf5150cbd..8fb6fadfe4c 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -1280,8 +1280,15 @@ function that converts absolute dates to dates of the appropriate type." | |||
| 1280 | (month "[0-9]+\\|\\*") | 1280 | (month "[0-9]+\\|\\*") |
| 1281 | (day "[0-9]+\\|\\*") | 1281 | (day "[0-9]+\\|\\*") |
| 1282 | (year "[0-9]+\\|\\*")) | 1282 | (year "[0-9]+\\|\\*")) |
| 1283 | (let* ((case-fold-search t) | 1283 | (let ((months-alist (if months (calendar-make-alist months) |
| 1284 | marks) | 1284 | (calendar-make-alist |
| 1285 | calendar-month-name-array | ||
| 1286 | 1 nil calendar-month-abbrev-array | ||
| 1287 | (mapcar (lambda (e) | ||
| 1288 | (format "%s." e)) | ||
| 1289 | calendar-month-abbrev-array)))) | ||
| 1290 | (case-fold-search t) | ||
| 1291 | marks) | ||
| 1285 | (dolist (date-form diary-date-forms) | 1292 | (dolist (date-form diary-date-forms) |
| 1286 | (if (eq (car date-form) 'backup) ; ignore 'backup directive | 1293 | (if (eq (car date-form) 'backup) ; ignore 'backup directive |
| 1287 | (setq date-form (cdr date-form))) | 1294 | (setq date-form (cdr date-form))) |
| @@ -1363,16 +1370,7 @@ function that converts absolute dates to dates of the appropriate type." | |||
| 1363 | (if mm-name | 1370 | (if mm-name |
| 1364 | (setq mm | 1371 | (setq mm |
| 1365 | (if (string-equal mm-name "*") 0 | 1372 | (if (string-equal mm-name "*") 0 |
| 1366 | (cdr (assoc-string | 1373 | (cdr (assoc-string mm-name months-alist t))))) |
| 1367 | mm-name | ||
| 1368 | (if months (calendar-make-alist months) | ||
| 1369 | (calendar-make-alist | ||
| 1370 | calendar-month-name-array | ||
| 1371 | 1 nil calendar-month-abbrev-array | ||
| 1372 | (mapcar (lambda (e) | ||
| 1373 | (format "%s." e)) | ||
| 1374 | calendar-month-abbrev-array))) | ||
| 1375 | t))))) | ||
| 1376 | (funcall markfunc mm dd yy marks))))))))) | 1374 | (funcall markfunc mm dd yy marks))))))))) |
| 1377 | 1375 | ||
| 1378 | ;;;###cal-autoload | 1376 | ;;;###cal-autoload |