From a167dce0569364095fbe714b5f5ec46859b11811 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 25 Oct 2023 17:05:31 +0200 Subject: [PATCH] Simplify attribute unpickler --- .../dotty/tools/dotc/core/tasty/AttributeUnpickler.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/tasty/AttributeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/AttributeUnpickler.scala index 6df2cfd0f73d..9bc061e57ba2 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/AttributeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/AttributeUnpickler.scala @@ -14,11 +14,9 @@ class AttributeUnpickler(reader: TastyReader): val attributesBuilder = List.newBuilder[String] while (!isAtEnd) { val length = readNat() - if (length > 0) { - val bytes = readBytes(length) - val attribute = new String(bytes, StandardCharsets.UTF_8) - attributesBuilder += attribute - } + val bytes = readBytes(length) + val attribute = new String(bytes, StandardCharsets.UTF_8) + attributesBuilder += attribute } attributesBuilder.result() }