From 0a3e444766b84fc778d673fcc1d5000056b3a2a4 Mon Sep 17 00:00:00 2001 From: fdai7057 Date: Mon, 6 Feb 2023 16:47:24 +0100 Subject: [PATCH] refactoring: renamed function calLen() to calculateStringLength and inner variables in order to increase readability. Now it is easier to understand. --- src/helperFunctions.c | 8 ++++---- src/helperFunctions.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/helperFunctions.c b/src/helperFunctions.c index 740c5a0..2fc211e 100644 --- a/src/helperFunctions.c +++ b/src/helperFunctions.c @@ -142,10 +142,10 @@ double balanceToDouble(char *balanceAsString) return sign * result / power; } -unsigned int calLen(char *str){ - int len = 0; - while(*(str+len)!='\0') ++len; - return len; +unsigned int calculateStringLength(char *string){ + int length = 0; + while(*(string+length)!='\0') ++length; + return length; } bool characterIsUpperCase(char inputCharacter) diff --git a/src/helperFunctions.h b/src/helperFunctions.h index 40146d1..a650e74 100644 --- a/src/helperFunctions.h +++ b/src/helperFunctions.h @@ -13,6 +13,6 @@ unsigned int power(unsigned int, unsigned int); bool everyCharacterIsDigit(char *); bool isLetterOfAlphabet(char *); double balanceToDouble(char *); -unsigned int calLen(); +unsigned int calculateStringLength(char *); bool charIsUpperCase(char ); #endif