Skip to content

Commit 0ee34d3

Browse files
lowassercopybara-github
authored andcommitted
Simplify (and optimize) Descriptors.FileDescriptor.latin1Cat.
PiperOrigin-RevId: 603529248
1 parent 2a28082 commit 0ee34d3

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

java/core/src/main/java/com/google/protobuf/Descriptors.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,7 @@ private static byte[] latin1Cat(final String[] strings) {
415415
if (strings.length == 1) {
416416
return strings[0].getBytes(Internal.ISO_8859_1);
417417
}
418-
StringBuilder descriptorData = new StringBuilder();
419-
for (String part : strings) {
420-
descriptorData.append(part);
421-
}
422-
return descriptorData.toString().getBytes(Internal.ISO_8859_1);
418+
return String.join("", strings).getBytes(Internal.ISO_8859_1);
423419
}
424420

425421
private static FileDescriptor[] findDescriptors(

0 commit comments

Comments
 (0)