Using LFS_ASSERT instead of an runtime check.

Remove NULL check from condition and assert callback is valid.
This commit is contained in:
daimiao chen
2026-03-05 16:56:03 -05:00
committed by Christopher Haster
parent 2311cd785a
commit fd5e7f6253
+2 -1
View File
@@ -1290,7 +1290,8 @@ static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs,
}
// found a match for our fetcher?
if ((fmask & tag) == (fmask & ftag) && (cb != NULL)) {
if ((fmask & tag) == (fmask & ftag)) {
LFS_ASSERT(cb != NULL);
int res = cb(data, tag, &(struct lfs_diskoff){
dir->pair[0], off+sizeof(tag)});
if (res < 0) {