Skip to content

Commit eaba9bf

Browse files
committed
add some preallocation
1 parent 2b4eb80 commit eaba9bf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/org/htmlunit/cyberneko/LostText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private static final class Entry {
4141
}
4242
}
4343

44-
private final List<Entry> entries_ = new ArrayList<>();
44+
private final List<Entry> entries_ = new ArrayList<>(4);
4545

4646
/**
4747
* Adds some text that need to be re-feed later. The information gets copied.

src/main/java/org/htmlunit/cyberneko/xerces/util/XMLAttributesImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class XMLAttributesImpl implements XMLAttributes {
4343

4444
/** Default constructor. */
4545
public XMLAttributesImpl() {
46-
attributes_ = new ArrayList<>();
46+
attributes_ = new ArrayList<>(4);
4747
}
4848

4949
/** Copy constructor. */
@@ -58,7 +58,7 @@ public XMLAttributesImpl(final XMLAttributesImpl attributes) {
5858
return;
5959
}
6060

61-
attributes_ = new ArrayList<>();
61+
attributes_ = new ArrayList<>(4);
6262
}
6363

6464
/**

0 commit comments

Comments
 (0)