xiaoxiang781216 commented on code in PR #21029:
URL: https://github.com/apache/nuttx/pull/21029#discussion_r4386468252
##########
fs/inode/fs_inodesearch.c:
##########
@@ -473,6 +538,18 @@ int inode_search_setup(FAR struct inode_search_s *desc,
}
#endif
+ /* Fast path for the common case where the caller already passes a simple
+ * absolute path. Avoid allocating a PATH_MAX temporary buffer and copying
+ * the string only to canonicalize it back to the same value. Keep the
+ * existing buffer path for nofollow searches so symbolic-link target
+ * handling can continue to rely on a mutable path buffer.
+ */
+
+ if (root == NULL && !nofollow && _inode_is_simple_abspath(path))
Review Comment:
could you reuse _inode_checkpath to avoid parsing the path twice
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]