[Github-comments] [geany/geany] Remove redundant code (PR #2962)

xiota notifications at xxxxx
Sat Nov 6 00:21:57 UTC 2021


@xiota 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)

What about this, to avoid rescanning the beginning of the string:
```C
if ((pos = strstr(string, "Entering directory")) != NULL)
{
	// ...

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

	// ...
}
```

-- 
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#pullrequestreview-799394905
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211105/d747de20/attachment.htm>


More information about the Github-comments mailing list