From b1b4b5ef4f789d741a3270bce06e84c157b78fd8 Mon Sep 17 00:00:00 2001 From: leleliu008 Date: Mon, 11 Sep 2023 06:48:20 +0800 Subject: [PATCH] optimized Signed-off-by: leleliu008 --- src/formula-parse.c | 8 +++----- src/formula-repo-parse.c | 8 +++----- src/receipt-parse.c | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/formula-parse.c b/src/formula-parse.c index f2acad4..b0fa011 100644 --- a/src/formula-parse.c +++ b/src/formula-parse.c @@ -136,15 +136,13 @@ static int uppm_formula_set_value(UPPMFormulaKeyCode keyCode, char * value, UPPM } for (;;) { - char c = value[0]; - - if (c == '\0') { + if (value[0] == '\0') { return UPPM_OK; } // non-printable ASCII characters and space - if (c <= 32) { - value = &value[1]; + if (value[0] <= 32) { + value++; } else { break; } diff --git a/src/formula-repo-parse.c b/src/formula-repo-parse.c index 8c0fb46..d7edb8c 100644 --- a/src/formula-repo-parse.c +++ b/src/formula-repo-parse.c @@ -93,15 +93,13 @@ static int uppm_formula_repo_set_value(UPPMFormulaRepoKeyCode keyCode, char * va } for (;;) { - char c = value[0]; - - if (c == '\0') { + if (value[0] == '\0') { return UPPM_OK; } // non-printable ASCII characters and space - if (c <= 32) { - value = &value[1]; + if (value[0] <= 32) { + value++; } else { break; } diff --git a/src/receipt-parse.c b/src/receipt-parse.c index dc0c37a..746b4ad 100644 --- a/src/receipt-parse.c +++ b/src/receipt-parse.c @@ -127,15 +127,13 @@ static int uppm_receipt_set_value(UPPMReceiptKeyCode keyCode, char * value, UPPM } for (;;) { - char c = value[0]; - - if (c == '\0') { + if (value[0] == '\0') { return UPPM_OK; } // non-printable ASCII characters and space - if (c <= 32) { - value = &value[1]; + if (value[0] <= 32) { + value++; } else { break; }