Optimization: Put grep -v empty task filter inside sed.

No need to spawn off another process for this; we can do this inside the sed command that joins the task numbers with the task text.
This commit is contained in:
Ingo Karkat
2011-12-23 22:52:07 +01:00
parent 17658c852d
commit 272cd5e469

View File

@@ -779,8 +779,8 @@ _list() {
N N
s/^/ / s/^/ /
s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 / s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 /
''' \ /^[ 0-9]\+ *$/d
| grep -v "^[ 0-9]\+ *$" '''
) )
if [ "${filter_command}" ]; then if [ "${filter_command}" ]; then
filtered_items=$(echo -n "$items" | eval "${filter_command}") filtered_items=$(echo -n "$items" | eval "${filter_command}")