From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7B251138247 for ; Sun, 10 Nov 2013 20:24:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3284BE0B01; Sun, 10 Nov 2013 20:24:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C160AE0B21 for ; Sun, 10 Nov 2013 20:24:23 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8251233EF49 for ; Sun, 10 Nov 2013 20:24:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 20AFAE545C for ; Sun, 10 Nov 2013 20:24:21 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1384107956.26c49888ff5c503a1149719f87cb3f4a3f941a50.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: libs/, / X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog libs/output.bash.in X-VCS-Directories: libs/ / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 26c49888ff5c503a1149719f87cb3f4a3f941a50 X-VCS-Branch: master Date: Sun, 10 Nov 2013 20:24:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 73cd2529-a8f9-4e74-8a8b-30e4b353c41f X-Archives-Hash: 7fa4848078f91639e1e862b5c767491f commit: 26c49888ff5c503a1149719f87cb3f4a3f941a50 Author: Ulrich Müller gentoo org> AuthorDate: Sun Nov 10 18:25:56 2013 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sun Nov 10 18:25:56 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=26c49888 Implement space function more efficiently. * libs/output.bash.in (space): Implement more efficiently. --- ChangeLog | 4 ++++ libs/output.bash.in | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0aad0e4..31418dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-11-10 Ulrich Müller + + * libs/output.bash.in (space): Implement more efficiently. + 2013-10-27 Ulrich Müller * autogen.bash: Update for aclocal 1.14. diff --git a/libs/output.bash.in b/libs/output.bash.in index ac934bb..78e0c4f 100644 --- a/libs/output.bash.in +++ b/libs/output.bash.in @@ -242,9 +242,8 @@ highlight_marker() { # space PUBLIC # Write $1 numbers of spaces space() { - local n ret="" - for (( n = 1; n <= $1; ++n )); do - ret="${ret} " + local n=$1 + while (( n-- > 0 )); do + echo -n " " done - echo -n "${ret}" }