Simplify (and optimize) Descriptors.FileDescriptor.latin1Cat.

PiperOrigin-RevId: 603529248
pull/15689/head
lowasser 10 months ago committed by Copybara-Service
parent 2a28082df3
commit 0ee34d35de
  1. 6
      java/core/src/main/java/com/google/protobuf/Descriptors.java

@ -415,11 +415,7 @@ public final class Descriptors {
if (strings.length == 1) { if (strings.length == 1) {
return strings[0].getBytes(Internal.ISO_8859_1); return strings[0].getBytes(Internal.ISO_8859_1);
} }
StringBuilder descriptorData = new StringBuilder(); return String.join("", strings).getBytes(Internal.ISO_8859_1);
for (String part : strings) {
descriptorData.append(part);
}
return descriptorData.toString().getBytes(Internal.ISO_8859_1);
} }
private static FileDescriptor[] findDescriptors( private static FileDescriptor[] findDescriptors(

Loading…
Cancel
Save