From 3eb92541db0161243852769a0be1598cdf33736a Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 20 Aug 2025 19:00:57 +0200 Subject: [PATCH] simplify the ptr increment a bit, so it's more clear what's going on --- src/dat/nbt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dat/nbt.c b/src/dat/nbt.c index b12ac68..feae51a 100644 --- a/src/dat/nbt.c +++ b/src/dat/nbt.c @@ -54,8 +54,9 @@ const u8 *nbt_nexttag(const u8 *restrict buf) { // TODO: move this into it's own function for readability. case NBT_LIST: { - tag = ptr; // temporarily store the tag to cache later - switch (*(ptr++)) { + tag = ptr; + ptr++; + switch (*tag) { case NBT_END: break; case NBT_I8: ptr += (i32)be32toh(*(u32 *)ptr) * 1; break; case NBT_I16: ptr += (i32)be32toh(*(u32 *)ptr) * 2; break;