Fix clang-tidy warning about NBT tag

This commit is contained in:
Roman Shishkin 2019-05-16 18:01:01 +03:00
parent f42b889154
commit 33a05cc8ef

View file

@ -87,7 +87,7 @@ void ChunkData::inflateChunk(Buffer buffer) {
void ChunkData::parseChunk() { void ChunkData::parseChunk() {
Buffer nbt(data.get(), len); Buffer nbt(data.get(), len);
std::pair<std::string, std::shared_ptr<const NBT::Tag>> tag = NBT::Tag::readNamedTag(&nbt); std::pair<std::string, std::shared_ptr<const NBT::Tag>> tag = NBT::Tag::readNamedTag(&nbt);
if (tag.first != "") if (!tag.first.empty())
throw std::invalid_argument("invalid root tag"); throw std::invalid_argument("invalid root tag");
root = assertValue(std::dynamic_pointer_cast<const NBT::CompoundTag>(tag.second)); root = assertValue(std::dynamic_pointer_cast<const NBT::CompoundTag>(tag.second));