Jean,

2014-03-06 13:41 GMT+01:00 Jean Delvare <[email protected]>:
> When quilt setup generates a series file, keep it open while we write
> to it, and close it only when we're done. For large patch series, it's
> much more efficient than individual redirections which open and close
> the file again and again.
>
> This change makes the generation of the series file about 10% faster
> in my tests, although it's hardly noticeable in practice because most
> of the time is spent elsewhere.

if you're *really* worried about the speed of this loop, a cleaner
approach would
be to remember all the patches in an array, e.g.,

declare -a patches
while read tag dir arg1 arg2
do
    [...]
        set -- "$arg1" $arg2
        patches[${#patches[@]}]="$*"
    [...]
done < $tmpfile

if [ ${#patches[@]} -gt 0 ]
then
    [...]
    (   echo ...
        printf "%s\n" "${patches[@]}"
    ) > "$prefix$dir/$QUILT_SERIES"
fi

Andreas

_______________________________________________
Quilt-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to