Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
Signed-off-by: leleliu008 <[email protected]>
  • Loading branch information
leleliu008 committed Sep 10, 2023
1 parent fb670aa commit b1b4b5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
8 changes: 3 additions & 5 deletions src/formula-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 3 additions & 5 deletions src/formula-repo-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 3 additions & 5 deletions src/receipt-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b1b4b5e

Please sign in to comment.