[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH 21/39] backup-files: Drop curly braces
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [PATCH 21/39] backup-files: Drop curly braces |
Date: |
Sat, 19 Mar 2011 10:52:51 +0100 |
User-agent: |
quilt/0.48-17.1 |
Don't use the ${VAR} construct when we don't have to, it's slightly
slower than simple variable names. Likewise, don't use quotes when
we don't have to.
Signed-off-by: Jean Delvare <address@hidden>
Reviewed-by: Raphael Hertzog <address@hidden>
---
quilt/scripts/backup-files.in | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -48,7 +48,7 @@ usage () {
. $QUILT_DIR/scripts/utilfns
ensure_nolinks() {
- local filename="$1"
+ local filename=$1
local link_count tmpname
link_count=$(stat @STAT_HARDLINK@ "$filename")
@@ -60,8 +60,8 @@ ensure_nolinks() {
}
backup() {
- local file="$1"
- local backup="${OPT_PREFIX}${file}"
+ local file=$1
+ local backup=$OPT_PREFIX$file
local dir
dir=$(dirname "$backup")
@@ -88,8 +88,8 @@ backup() {
# the backup files or touching target files after restoration.
restore_fast()
{
- local file="$1"
- local backup="${OPT_PREFIX}${file}"
+ local file=$1
+ local backup=$OPT_PREFIX$file
if [ ! -s "$backup" ]; then
$ECHO "Removing $file"
@@ -105,8 +105,8 @@ restore_fast()
restore()
{
- local file="$1"
- local backup="${OPT_PREFIX}${file}"
+ local file=$1
+ local backup=$OPT_PREFIX$file
if [ ! -e "$backup" ]; then
return 1
@@ -142,8 +142,8 @@ restore()
remove()
{
- local file="$1"
- local backup="${OPT_PREFIX}${file}"
+ local file=$1
+ local backup=$OPT_PREFIX$file
if [ -e "$backup" ]; then
rm "$backup"
@@ -153,7 +153,7 @@ remove()
noop()
{
- local file="$1"
+ local file=$1
if [ -e "$file" ] && [ -n "$OPT_NOLINKS" ]; then
ensure_nolinks "$file"
- [Quilt-dev] [PATCH 00/39] Reimplement backup-files in bash, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 03/39] BSD compatibility: cp, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 02/39] BSD compatibility: stat, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 21/39] backup-files: Drop curly braces,
Jean Delvare <=
- [Quilt-dev] [PATCH 07/39] backup-files: Skip test for file presence, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 18/39] backup-files: Make input methods mutually exclusive, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 25/39] backup-files: Separate function restore_all, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 26/39] backup-files: Quick exit when unlinking is not needed, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 13/39] backup-files: Split code to sparate functions, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 24/39] backup-files: Avoid negations, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 14/39] backup-files: Mass reindent, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 01/39] Make backup-files a shell script, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 22/39] backup-files: Check if backup exists, Jean Delvare, 2011/03/19