[Github-comments] [geany/geany] Avoid re-scanning the string (PR #2962)

Avinash Sonawane notifications at xxxxx
Thu Nov 25 05:40:35 UTC 2021


@rootkea commented on this pull request.



> @@ -1057,7 +1057,7 @@ gboolean build_parse_make_dir(const gchar *string, gchar **prefix)
 	if (string == NULL)
 		return FALSE;
 
-	if ((pos = strstr(string, "Entering directory")) != NULL)
+	if (strstr(string, "Entering directory") != NULL)

@xiota 

> pos = strstr(pos, "/");   // instead of ... pos = strstr(string, "/");

Sounds good! I'll update the PR. Thanks!

> Are there any tangible benefits besides maybe saving a few processor cycles or avoiding some nested function call?

Why to not save maybe a few processor cycles or not avoid some nested function call? :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2962#discussion_r756585061
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211124/314f8cc7/attachment.htm>


More information about the Github-comments mailing list