diff options
author | Ron Yorston | 2021-03-25 14:21:49 +0000 |
---|---|---|
committer | Denys Vlasenko | 2021-03-29 12:05:53 +0200 |
commit | 776b56d774fec51e0ac3f9714adbdb2375c6bda7 (patch) | |
tree | 5ff9ef7e62eea04b8b3e6f43dc4c98cd4061563d /.gitignore | |
parent | 7b4c2276a89fca0dfedf73db07fbe20fff17a0de (diff) | |
download | busybox-776b56d774fec51e0ac3f9714adbdb2375c6bda7.zip busybox-776b56d774fec51e0ac3f9714adbdb2375c6bda7.tar.gz |
vi: code shrink
I was puzzled by code in find_range() which handles forward word
movement. It included a test to see if we're at the start of a
word. Since these are forward word movements surely we'd expect to
be at the start of a word? In fact, the test was intended to fix a
problem with changes to the last word in a file, as discussed in the
thread starting here:
http://lists.busybox.net/pipermail/busybox/2004-January/044552.html
The code can be simplified by testing directly for end of file instead
of indirectly for not being at the start of a word. Since trailing
whitespace is now handled in do_cmd() the code to back up off a newline
is no longer required.
function old new delta
find_range 619 514 -105
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-105) Total: -105 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions