aboutsummaryrefslogtreecommitdiff
path: root/src/str/ft_strcmp.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-11 21:07:32 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-11 21:23:49 +0100
commitc128213daa677d548bfc2905496257fe4a4faf79 (patch)
treed087ceaeff3124ff539bc05d834d79f8187d5628 /src/str/ft_strcmp.c
parent3c3f1115f6e9a9b914e2dcbd796501ca7ce85342 (diff)
downloadlibft-c128213daa677d548bfc2905496257fe4a4faf79.tar.gz
libft-c128213daa677d548bfc2905496257fe4a4faf79.tar.bz2
libft-c128213daa677d548bfc2905496257fe4a4faf79.zip
ft_mem* and ft_strlen optimization
Diffstat (limited to 'src/str/ft_strcmp.c')
-rw-r--r--src/str/ft_strcmp.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/str/ft_strcmp.c b/src/str/ft_strcmp.c
index aced711..25d2972 100644
--- a/src/str/ft_strcmp.c
+++ b/src/str/ft_strcmp.c
@@ -14,10 +14,5 @@
int ft_strcmp(const char *s1, const char *s2)
{
- while (*s1 && *s2 && *s1 == *s2)
- {
- s1++;
- s2++;
- }
- return (*s1 - *s2);
+ return (ft_memcmp(s1, s2, ft_strlen(s1) + 1));
}