diff options
| author | Alan Mackenzie | 2016-07-03 18:13:51 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2016-07-03 18:13:51 +0000 |
| commit | 9e54c5250d87e64a4a7f2423f217c4444bcf3449 (patch) | |
| tree | 2e83c7d3d67cfed000dfbc3bfe8e1d51de11d66e | |
| parent | 4b9ac23960d2998f899287ffcf696ad33b63a69a (diff) | |
| download | emacs-9e54c5250d87e64a4a7f2423f217c4444bcf3449.tar.gz emacs-9e54c5250d87e64a4a7f2423f217c4444bcf3449.zip | |
Remove redundant forms from CC Mode for faster fontification
* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Remove four arms of
the "main" cond form in the function, which have been redundant since the
extraction of c-font-lock-cut-off-declarators from the function on
2016-06-15/16.
| -rw-r--r-- | lisp/progmodes/cc-fonts.el | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index f122a95feb5..dfc2c061217 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -1403,50 +1403,6 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1403 | (c-fontify-recorded-types-and-refs) | 1403 | (c-fontify-recorded-types-and-refs) |
| 1404 | nil)) | 1404 | nil)) |
| 1405 | 1405 | ||
| 1406 | ;; Restore point, since at this point in the code it has been | ||
| 1407 | ;; left undefined by c-forward-decl-or-cast-1 above. | ||
| 1408 | ((progn (goto-char start-pos) nil)) | ||
| 1409 | |||
| 1410 | ;; If point is inside a bracelist, there's no point checking it | ||
| 1411 | ;; being at a declarator. | ||
| 1412 | ((let ((paren-state (c-parse-state))) | ||
| 1413 | (setq lbrace (c-cheap-inside-bracelist-p paren-state))) | ||
| 1414 | ;; Move past this bracelist to prevent an endless loop. | ||
| 1415 | (goto-char lbrace) | ||
| 1416 | (unless (c-safe (progn (forward-list) t)) | ||
| 1417 | (goto-char start-pos) | ||
| 1418 | (c-forward-token-2)) | ||
| 1419 | nil) | ||
| 1420 | |||
| 1421 | ;; If point is just after a ")" which is followed by an | ||
| 1422 | ;; identifier which isn't a label, or at the matching "(", we're | ||
| 1423 | ;; at either a macro invocation, a cast, or a | ||
| 1424 | ;; for/while/etc. statement. The cast case is handled above. | ||
| 1425 | ;; None of these cases can contain a declarator. | ||
| 1426 | ((or (and (eq (char-before match-pos) ?\)) | ||
| 1427 | (c-on-identifier) | ||
| 1428 | (save-excursion (not (c-forward-label)))) | ||
| 1429 | (and (eq (char-after) ?\() | ||
| 1430 | (save-excursion | ||
| 1431 | (and | ||
| 1432 | (progn (c-backward-token-2) (c-on-identifier)) | ||
| 1433 | (save-excursion (not (c-forward-label))) | ||
| 1434 | (progn (c-backward-token-2) | ||
| 1435 | (eq (char-after) ?\()))))) | ||
| 1436 | (c-forward-token-2) ; Must prevent looping. | ||
| 1437 | nil) | ||
| 1438 | |||
| 1439 | ((and (not c-enums-contain-decls) | ||
| 1440 | ;; An optimization quickly to eliminate scans of long enum | ||
| 1441 | ;; declarations in the next cond arm. | ||
| 1442 | (let ((paren-state (c-parse-state))) | ||
| 1443 | (and | ||
| 1444 | (numberp (car paren-state)) | ||
| 1445 | (save-excursion | ||
| 1446 | (goto-char (car paren-state)) | ||
| 1447 | (c-backward-over-enum-header))))) | ||
| 1448 | (c-forward-token-2) | ||
| 1449 | nil) | ||
| 1450 | (t t))) | 1406 | (t t))) |
| 1451 | 1407 | ||
| 1452 | ;; It was a false alarm. Check if we're in a label (or other | 1408 | ;; It was a false alarm. Check if we're in a label (or other |