Take good advice and streamline code

This commit is contained in:
caitianchi 2024-10-16 17:15:22 +08:00
parent 93f85ea213
commit c1fb24fe1f

View File

@ -1969,13 +1969,10 @@ bool clip_image_preprocess(struct clip_ctx * ctx, const clip_image_u8 * img, cli
for (size_t i = 0; i < imgs.size(); ++i) { for (size_t i = 0; i < imgs.size(); ++i) {
for (size_t j = 0; j < imgs[i].size(); ++j) { for (size_t j = 0; j < imgs[i].size(); ++j) {
if (imgs[i][j] != nullptr) { if (imgs[i][j] != nullptr) {
imgs[i][j]->buf.clear();
delete imgs[i][j]; delete imgs[i][j];
} }
} }
imgs[i].clear();
} }
imgs.clear();
return true; return true;
} }