@@ -14,6 +14,8 @@ using namespace vpkpp;
1414
1515namespace {
1616
17+ // NOLINTBEGIN(*-branch-clone)
18+
1719// Convert some Vulkan 1.0 formats to corresponding DXGI formats
1820[[nodiscard]] constexpr uint32_t mapVkFormatToDXGIFormat (uint32_t format) {
1921 switch (format) {
@@ -214,6 +216,8 @@ namespace {
214216 return false ;
215217}
216218
219+ // NOLINTEND(*-branch-clone)
220+
217221} // namespace
218222
219223uint32_t PKG::Asset::getBlobIndex (int frame, int face, int mip) const {
@@ -241,8 +245,10 @@ std::unique_ptr<PackFile> PKG::open(const std::string& path, const EntryCallback
241245
242246 if (path.length () >= 7 && string::matches (path.substr (path.length () - 7 , path.length ()), " _%d%d.pkg" )) {
243247 for (int i = 0 ; true ; i++) {
244- const auto numberedPath = pkg->getTruncatedFilepath () + " _" + string::padNumber (i, 2 ) + PKG_EXTENSION .data ();
245- if (!pkg->openNumbered (i, numberedPath, callback)) {
248+ if (
249+ const auto numberedPath = pkg->getTruncatedFilepath () + " _" + string::padNumber (i, 2 ) + PKG_EXTENSION .data ();
250+ !pkg->openNumbered (i, numberedPath, callback)
251+ ) {
246252 if (i == 0 ) {
247253 return nullptr ;
248254 }
@@ -371,8 +377,7 @@ std::optional<std::vector<std::byte>> PKG::readEntry(const std::string& path_) c
371377
372378 // Add blobs
373379 const auto readBlob = [&stream, &blobs, &writer](uint32_t i, uint64_t blobUncompressedSize) {
374- const auto & blob = blobs[i];
375- switch (blob.compression ) {
380+ switch (const auto & blob = blobs[i]; blob.compression ) {
376381 case Blob::Compression::NONE : {
377382 writer << stream.seek_in_u (blob.offset ).read_bytes (blob.size );
378383 break ;
0 commit comments