pkarashchenko commented on code in PR #8194:
URL: https://github.com/apache/nuttx/pull/8194#discussion_r1082963845
##########
fs/inode/fs_files.c:
##########
@@ -298,7 +301,10 @@ int files_duplist(FAR struct filelist *plist, FAR struct
filelist *clist)
#endif
filep = &plist->fl_files[i][j];
- if (filep->f_inode == NULL || (filep->f_oflags & O_CLOEXEC) != 0)
+ DEBUGASSERT(filep);
+
+ if (filep && (filep->f_inode == NULL ||
+ (filep->f_oflags & O_CLOEXEC) != 0))
Review Comment:
But in such case if `filep` is checked unconditionally shouldn't we move the
assert before `continue`, so that will eliminate unnecessary duplicated NULL
check?
--
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]