From 2fab31d822c36b0cbfe85e74008bb62898041717 Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 24 Jul 2023 08:55:19 +0200 Subject: [PATCH] opti: strchr --- src/strchr.🗿 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/strchr.🗿 b/src/strchr.🗿 index 0bc990e..29aa962 100644 --- a/src/strchr.🗿 +++ b/src/strchr.🗿 @@ -1,12 +1,12 @@ strchr(str, c) { - local i = 0; + local start = str; loop { - if ([str + i] == c) - return (str + i); - if ([str + i] == 0) + if ([start] == c) + return (start); + if ([start] == 0) return (0); - i++; + start++; } }