Mercurial > vim
comparison src/ex_docmd.c @ 24665:661d15592d3c v8.2.2871
patch 8.2.2871: unnessary VIM_ISDIGIT() calls, badly indented code
Commit: https://github.com/vim/vim/commit/4781d6fd8670af415c3b78f00d70036af85bd286
Author: Dominique Pelle <dominique.pelle@gmail.com>
Date: Tue May 18 21:46:31 2021 +0200
patch 8.2.2871: unnessary VIM_ISDIGIT() calls, badly indented code
Problem: Unnessary VIM_ISDIGIT() calls, badly indented code.
Solution: Call skipdigits() on the next character. Improve indenting.
(Dominique Pell?, closes #8227)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 18 May 2021 22:00:05 +0200 |
parents | 83877a1b66fd |
children | a6e43da449af |
comparison
equal
deleted
inserted
replaced
24664:a9cb1f88ff40 | 24665:661d15592d3c |
---|---|
2382 /* | 2382 /* |
2383 * Check for a count. When accepting a EX_BUFNAME, don't use "123foo" as a | 2383 * Check for a count. When accepting a EX_BUFNAME, don't use "123foo" as a |
2384 * count, it's a buffer name. | 2384 * count, it's a buffer name. |
2385 */ | 2385 */ |
2386 if ((ea.argt & EX_COUNT) && VIM_ISDIGIT(*ea.arg) | 2386 if ((ea.argt & EX_COUNT) && VIM_ISDIGIT(*ea.arg) |
2387 && (!(ea.argt & EX_BUFNAME) || *(p = skipdigits(ea.arg)) == NUL | 2387 && (!(ea.argt & EX_BUFNAME) || *(p = skipdigits(ea.arg + 1)) == NUL |
2388 || VIM_ISWHITE(*p))) | 2388 || VIM_ISWHITE(*p))) |
2389 { | 2389 { |
2390 n = getdigits(&ea.arg); | 2390 n = getdigits(&ea.arg); |
2391 ea.arg = skipwhite(ea.arg); | 2391 ea.arg = skipwhite(ea.arg); |
2392 if (n <= 0 && !ni && (ea.argt & EX_ZEROR) == 0) | 2392 if (n <= 0 && !ni && (ea.argt & EX_ZEROR) == 0) |
3728 { | 3728 { |
3729 int i, j; | 3729 int i, j; |
3730 char_u *p = cmd; | 3730 char_u *p = cmd; |
3731 | 3731 |
3732 if (VIM_ISDIGIT(*cmd)) | 3732 if (VIM_ISDIGIT(*cmd)) |
3733 p = skipwhite(skipdigits(cmd)); | 3733 p = skipwhite(skipdigits(cmd + 1)); |
3734 for (i = 0; i < (int)(sizeof(cmdmods) / sizeof(struct cmdmod)); ++i) | 3734 for (i = 0; i < (int)(sizeof(cmdmods) / sizeof(struct cmdmod)); ++i) |
3735 { | 3735 { |
3736 for (j = 0; p[j] != NUL; ++j) | 3736 for (j = 0; p[j] != NUL; ++j) |
3737 if (p[j] != cmdmods[i].name[j]) | 3737 if (p[j] != cmdmods[i].name[j]) |
3738 break; | 3738 break; |