diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2017-10-11 23:14:07 -0700 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-10-12 08:14:07 +0200 |
commit | ed0545201445ecf2476ba0dd2168afa9052eb9c5 (patch) | |
tree | 600660391354d3aa49745fb9054fc61c5ce2ce13 /shell-completion/zsh | |
parent | 709dbeac14447a06886bdf8d42016f0101bca5a8 (diff) | |
download | systemd-ed0545201445ecf2476ba0dd2168afa9052eb9c5.tar.gz |
shared: add vectorized parse_field() (#7056)
By vectorizing parse_field() the chain of parse_field() calls in
output_short() can be replaced with a single call receiving a description
of the desired fields and their targets.
While at it, eliminate the repeated strlen() calls performed on constant
field names by making parse_field() receive the field length, and storing
it in the ParseFieldVec at compile time.
Also sort the output_short() fields so the short ones are tried first, for
a minor efficiency gain.
In addition to making the code less repetitive, gcc in my tests now inlines
the parse_fieldv() call in output_short().
Diffstat (limited to 'shell-completion/zsh')
0 files changed, 0 insertions, 0 deletions